Page 1 of 1
Change of Base address.
Posted: Thu Feb 03, 2005 11:48 am
by stonedzealot
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...?
Re:Change of Base address.
Posted: Thu Feb 03, 2005 3:14 pm
by Candy
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.
That's an error Tim admitted at least a year ago, search the forum some more. The address should have been 0x40100000.
Re:Change of Base address.
Posted: Thu Feb 03, 2005 6:02 pm
by stonedzealot
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...
Re:Change of Base address.
Posted: Fri Feb 04, 2005 4:36 am
by Pype.Clicker
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...
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 it
Re:Change of Base address.
Posted: Fri Feb 04, 2005 6:50 am
by Candy
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...
Everybody who thinks Tim is a human would think he can make errors too, and try out the alternative. NOFI btw.
Re:Change of Base address.
Posted: Sat Feb 05, 2005 10:58 pm
by thomasantony
Hi,
Dont you think you should put something like an [org 0xc000000] in the kernel file?
Thomas Antony
Re:Change of Base address.
Posted: Sun Feb 06, 2005 3:41 am
by AR
Dont you think you should put something like an [org 0xc000000] in the kernel file?
I don't see the point of that, the linker will change the origin anyway.