_nobody_
Posts: 1
Joined: Tue Nov 20, 2012 8:39 am

Bare Metal OS CR0 config on x86 64 architecture?!

Tue Nov 20, 2012 9:54 am

Hello to everyone,

I am running Bare Metal OS on x86 64 Core 2 architecture. I have real dilemma while running very intensive Real Time application on this HW. I am running it in Protected Mode.

Control Register 0 (CR0) register has bit 0 as PE (Protected Mode Enabled) and bit 31 as PG (Paging Enable). It is obvious that PE must be enabled (for PM - 4GB mode to run, instead Real Mode - 1MB). The system has 256MB of memory.

Intention is to make system as fast as can (close to the metal). In my opinion, there is NO NEED to switch PG ON, since the paging mechanism via Translation Lookaside Buffers (TLBs) will slow the system.

What do you suggest, should I enable PG or NOT, and why?

_nobody_

dwelch67
Posts: 955
Joined: Sat May 26, 2012 5:32 pm

Re: Bare Metal OS CR0 config on x86 64 architecture?!

Tue Nov 20, 2012 2:55 pm

The Raspberry Pi uses an ARM processor not an intel x86.

User avatar
DexOS
Posts: 876
Joined: Wed May 16, 2012 6:32 pm
Contact: Website

Re: Bare Metal OS CR0 config on x86 64 architecture?!

Tue Nov 20, 2012 7:23 pm

On the x86 64, Paging Enable needs to be set, if you want to run in 64bit mode, you then need to map it 1 to 1, to act as close to bare metal.
That's one of the reasons, i stuck to 32bit mode.
Batteries not included, Some assembly required.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23331
Joined: Sat Jul 30, 2011 7:41 pm

Re: Bare Metal OS CR0 config on x86 64 architecture?!

Wed Nov 21, 2012 10:27 am

_nobody_ wrote:Hello to everyone,

I am running Bare Metal OS on x86 64 Core 2 architecture. I have real dilemma while running very intensive Real Time application on this HW. I am running it in Protected Mode.

Control Register 0 (CR0) register has bit 0 as PE (Protected Mode Enabled) and bit 31 as PG (Paging Enable). It is obvious that PE must be enabled (for PM - 4GB mode to run, instead Real Mode - 1MB). The system has 256MB of memory.

Intention is to make system as fast as can (close to the metal). In my opinion, there is NO NEED to switch PG ON, since the paging mechanism via Translation Lookaside Buffers (TLBs) will slow the system.

What do you suggest, should I enable PG or NOT, and why?

_nobody_
Whilst I admire you efforts, this is a website/forum for the Raspberry Pi SBC, not Intel devices, so please refrain from posting off topic messages.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

Return to “Bare metal, Assembly language”