I'm finally getting around to getting the kernel restricted to >=2GB in address space. I read Tim Robinson's Memory Management 1 tutorial at osdever a long time ago and remembered him mentioning it. He says that the base address should be changed to 0x41000000 because 0xC0000000 + 0x41000000 = 0x1000000 which is 1MB (*somehow*) I thought that it should be 0x40100000 so you'd get 0x100000 out (5 zeros vs. 6) which would be 1MB.
Regardless, whatever the magic number is, what do I have to change with it? This is the way I understand it (but it doesn't work):
Kernel is linked for 0xC0000000
Bootloader loads the kernel to 0x100000
Bootloader lgdts GDT with CODESEL and DATASEL bases set to the magic number (whichever it is).
Bootloader jumps to CODESEL:0xC0000000
and operation continues as usual...
So what's wrong with this picture, since it's not really working...?
Change of Base address.
Re:Change of Base address.
That's an error Tim admitted at least a year ago, search the forum some more. The address should have been 0x40100000.wangpeng wrote: I'm finally getting around to getting the kernel restricted to >=2GB in address space. I read Tim Robinson's Memory Management 1 tutorial at osdever a long time ago and remembered him mentioning it. He says that the base address should be changed to 0x41000000 because 0xC0000000 + 0x41000000 = 0x1000000 which is 1MB (*somehow*) I thought that it should be 0x40100000 so you'd get 0x100000 out (5 zeros vs. 6) which would be 1MB.
Re:Change of Base address.
I'm not trying to indict him or anything for chrissake, I was just asking what I wasn't doing. As far as I knew he was right (it's not like he's led me wrong before) and the extra zero was supposed to be there. The search term "0x40100000" turned up the discussion I was looking for however, so nevermind.
Besides, who would assume there's an error in a tutorial... shouldn't it be changed after someone makes a realization? Especially something on osdever that probably gets read a lot... no point in spreading false information...
Besides, who would assume there's an error in a tutorial... shouldn't it be changed after someone makes a realization? Especially something on osdever that probably gets read a lot... no point in spreading false information...
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Change of Base address.
That's why the FAQ is a wiki, here ... If you manage to find people being able to patch the fault, please, feel free to have them chaning itwangpeng wrote: Besides, who would assume there's an error in a tutorial... shouldn't it be changed after someone makes a realization? Especially something on osdever that probably gets read a lot... no point in spreading false information...
Re:Change of Base address.
Everybody who thinks Tim is a human would think he can make errors too, and try out the alternative. NOFI btw.wangpeng wrote: Besides, who would assume there's an error in a tutorial... shouldn't it be changed after someone makes a realization? Especially something on osdever that probably gets read a lot... no point in spreading false information...
Re:Change of Base address.
Hi,
Dont you think you should put something like an [org 0xc000000] in the kernel file?
Thomas Antony
Dont you think you should put something like an [org 0xc000000] in the kernel file?
Thomas Antony
Re:Change of Base address.
I don't see the point of that, the linker will change the origin anyway.Dont you think you should put something like an [org 0xc000000] in the kernel file?