How to place kernel in high memory area
Posted: Mon Aug 28, 2006 4:27 am
Hi
I'm working on a bootloader and want it to load kernel at physical address 0x01000000 (16mb), because DMA will use the first 16mb later. How is this done? I was thinking something like:
(maybe put all this in a 2nd stage bootloader)
1. Enable A20
2. Switch to unreal mode
3. Locate kernel on disk
4. Set es:bx to a buffer <1mb mem area and use int13,2 (read sectors)
5. Move kernel from <1mb area to 0x01000000 (16mb)
6. Setup p-mode
7. Execute kernel
Think this will work, but I find it ugly that the kernel first have to be read to area below 1mb and then moved. How is a kernel 'normally' loaded into higher memory area?
Thanks!
I'm working on a bootloader and want it to load kernel at physical address 0x01000000 (16mb), because DMA will use the first 16mb later. How is this done? I was thinking something like:
(maybe put all this in a 2nd stage bootloader)
1. Enable A20
2. Switch to unreal mode
3. Locate kernel on disk
4. Set es:bx to a buffer <1mb mem area and use int13,2 (read sectors)
5. Move kernel from <1mb area to 0x01000000 (16mb)
6. Setup p-mode
7. Execute kernel
Think this will work, but I find it ugly that the kernel first have to be read to area below 1mb and then moved. How is a kernel 'normally' loaded into higher memory area?
Thanks!