mabye simple,but i confused
in understangding the linux kernel, the authors says "..Moves itself from address 0x00007c00 to address 0x00090000.."
What i confused is why the Boot Loader do this, i asked google,but still no answe.
who can make me understand it ?
Thanks.
* guorke <[email protected]> dixit:
Quoted 6 lines
in understangding the linux kernel, the authors says "..Moves itself from address
0x00007c00to address0x00090000.."What i confused is why the Boot Loader do this, i asked google,but still no answe.
who can make me understand it ?
Well, let's start with the Master Boot Record. In PC's the BIOS
loads the MBR at address 0x7c00, but the MBR is responsible for loading the OS bootsector, if any. And the bootsectors are written assuming that they're loaded by a MBR or *by the BIOS itself* so the address they assume is 0x7c00. But the MBR is already at that address! What can it do? Well, it moves itself out of the place.
The problem is that the kernel itself could be loaded directly by
the BIOS (a long time ago, it was possible to boot from a raw floppy containing an image of the kernel), and the first sector would be loaded at 0x7c00, so the bootsector, MBR, loader or whatever has to move out of that address at the very beginning. Why the physical address 0x00090000 was used? I don't know. Well, it's well at the top of the 640k base memory and the segment starts with 1001 in binary, which is a fancy number XDD
Hope that helps.
Raúl Núñez de Arenas Coronado
Signature · 3 lines
Linux Registered User 88736 | http://www.dervishd.net http://www.pleyades.net & http://www.gotesdelluna.net It's my PC and I'll cry if I want to...
yes,DervishD.you give me a lot of help! Thanks
Quoted 33 lines · DervishD
* guorke <[email protected]> dixit:
Quoted 6 lines
in understangding the linux kernel, the authors says "..Moves itself from address
0x00007c00to address0x00090000.."What i confused is why the Boot Loader do this, i asked google,but still no answe.
who can make me understand it ?Well, let's start with the Master Boot Record. In PC's the BIOS
loads the MBR at address0x7c00, but the MBR is responsible for loading the OS bootsector, if any. And the bootsectors are written assuming that they're loaded by a MBR or *by the BIOS itself* so the address they assume is0x7c00. But the MBR is already at that address! What can it do? Well, it moves itself out of the place.The problem is that the kernel itself could be loaded directly by
the BIOS (a long time ago, it was possible to boot from a raw floppy containing an image of the kernel), and the first sector would be loaded at0x7c00, so the bootsector, MBR, loader or whatever has to move out of that address at the very beginning. Why the physical address0x00090000was used? I don't know. Well, it's well at the top of the 640k base memory and the segment starts with 1001 in binary, which is a fancy number XDDHope that helps.
Raúl Núñez de Arenas Coronado
--
Linux Registered User 88736 | http://www.dervishd.net
http://www.pleyades.net & http://www.gotesdelluna.net
It's my PC and I'll cry if I want to...
Quoted 7 lines · guorke
in understangding the linux kernel, the authors says "..Moves itself from address
0x00007c00to address0x00090000.."What i confused is why the Boot Loader do this, i asked google,but still no answe.
who can make me understand it ?
Thanks.
The IBM 'IPL' (initial program load) address was specified to be at 7c00. There was room here for only one "sector", which in the early days was 512 bytes. The very first sector, the boot sector, was loaded into this address and then execution was started at a specified offset so that this boot code could load the rest of the operating system. To load the rest of the operating system, one needs to move the boot-code to somewhere it won't get overwritten by subsequent reads from the disk.
To load Linux, the boot developers wanted to load code 64k at a time. The only address in real-mode, that was guaranteed to not be in use, where the boot code could load a whole 64k was at 90000 hex. This provides a buffer from which the boot-loader can copy 64k at a time into the protected-mode address space starting at 0x00100000. The boot-loader uses real-mode BIOS services to copy the code to the 1 megabyte address which can't be reached in real mode.
Cheers,
Dick Johnson
Penguin : Linux version 2.6.11.9 on an i686 machine (5537.79 BogoMips).
Notice : All mail here is now cached for review by Dictator Bush.
98.36% of all statistics are fiction.
Thanks,I must read it carefully
Quoted 34 lines · Richard B. Johnson
Quoted 7 lines · guorke
in understangding the linux kernel, the authors says "..Moves itself from address
0x00007c00to address0x00090000.."What i confused is why the Boot Loader do this, i asked google,but still no answe.
who can make me understand it ?
Thanks.The IBM 'IPL' (initial program load) address was specified to be at 7c00. There was room here for only one "sector", which in the early days was 512 bytes. The very first sector, the boot sector, was loaded into this address and then execution was started at a specified offset so that this boot code could load the rest of the operating system. To load the rest of the operating system, one needs to move the boot-code to somewhere it won't get overwritten by subsequent reads from the disk.
To load Linux, the boot developers wanted to load code 64k at a time. The only address in real-mode, that was guaranteed to not be in use, where the boot code could load a whole 64k was at 90000 hex. This provides a buffer from which the boot-loader can copy 64k at a time into the protected-mode address space starting at
0x00100000. The boot-loader uses real-mode BIOS services to copy the code to the 1 megabyte address which can't be reached in real mode.Cheers,
Dick Johnson
Penguin : Linux version 2.6.11.9 on an i686 machine (5537.79 BogoMips).
Notice : All mail here is now cached for review by Dictator Bush.
98.36% of all statistics are fiction.