How to load kernel in custom bootloader
-
- Posts: 2
- Joined: Sun Feb 05, 2012 1:22 am
How to load kernel in custom bootloader
Hi everyone,
I currently have a custom bootloader OS that works fine, but the 512 byte size limit is a major problem. I've tried adding code after the boot signature but obviously it can't be read since only the 512 bytes are being loaded into memory. Could anyone tell me how I'm supposed to load more than 512 bytes into memory? Any specific commands, techniques, etc would be greatly appreciated. Im developing on Mac, testing on virtualbox, and using nasm to compile.
The code I already have: http://filecabwebsite.kodingen.com/files/boot.txt
I currently have a custom bootloader OS that works fine, but the 512 byte size limit is a major problem. I've tried adding code after the boot signature but obviously it can't be read since only the 512 bytes are being loaded into memory. Could anyone tell me how I'm supposed to load more than 512 bytes into memory? Any specific commands, techniques, etc would be greatly appreciated. Im developing on Mac, testing on virtualbox, and using nasm to compile.
The code I already have: http://filecabwebsite.kodingen.com/files/boot.txt
- eaglexrlnk
- Posts: 11
- Joined: Tue Nov 08, 2011 8:30 am
- Location: Ukraine
Re: How to load kernel in custom bootloader
Hello!
Of course it is very hard to get much of 512 bytes, but you don't have to. Usually bootloaders are split into several stages, each of which is doing its own job and giving control to the next one. The classical bootloader consists of two stages: first one just loads the second stage, which handles all the other stuff of initialization and loading your operating system. The other option is to use GRUB and focus on you kernel design.
Good luck!
EDIT: Or you could wait until May (see the topic about contest)
Of course it is very hard to get much of 512 bytes, but you don't have to. Usually bootloaders are split into several stages, each of which is doing its own job and giving control to the next one. The classical bootloader consists of two stages: first one just loads the second stage, which handles all the other stuff of initialization and loading your operating system. The other option is to use GRUB and focus on you kernel design.
Good luck!
EDIT: Or you could wait until May (see the topic about contest)
"A
computer program
does what you tell it
to do, not what you
want it to do." --
Greer's Third Law
computer program
does what you tell it
to do, not what you
want it to do." --
Greer's Third Law
Re: How to load kernel in custom bootloader
If you have not yet check the wiki, it's a very good place to start. Since you have limited code size, basically you read from storage with some sort of API, be that old fashion BIOS disk service, EFI, or network boot APIs.
Re: How to load kernel in custom bootloader
Can we enable A_20 at the bootloader stage and get more???
Re: How to load kernel in custom bootloader
Yes.Yashas wrote:Can we enable A_20 at the bootloader stage
More what?Yashas wrote:and get more???
PS. It's not a good idea to hijack a thread.
Re: How to load kernel in custom bootloader
Memory more than 1MB
Re: How to load kernel in custom bootloader
Yes you can.
-
- Posts: 2
- Joined: Sun Feb 05, 2012 1:22 am
Re: How to load kernel in custom bootloader
I've read through everything on the wiki and searched the forums but didn't find anything very helpful since I have no clue how this is supposed to be done. Is there any example code you could link me to?
Re: How to load kernel in custom bootloader
Corkthomas wrote:I've read through everything on the wiki and searched the forums but didn't find anything very helpful since I have no clue how this is supposed to be done.
Read them 10 times and you will see things that helpful.
- DavidCooper
- Member
- Posts: 1150
- Joined: Wed Oct 27, 2010 4:53 pm
- Location: Scotland
Re: How to load kernel in custom bootloader
What is all that stuff in your bootsector? Your immediate priority in a boot sector is to load more sectors in and not to display lots of data to the screen. Bluemoon said something about BIOS disk service, which might be a useful clue. I've just googled that to see what happens and the second search result was http://en.wikipedia.org/wiki/INT_13H - that should give you a few ideas about what you need to do.
Out of interest, what are you booting from? Floppy disk? Hard disk? USB flash drive? Real disk or disk image?
Out of interest, what are you booting from? Floppy disk? Hard disk? USB flash drive? Real disk or disk image?
Help the people of Laos by liking - https://www.facebook.com/TheSBInitiative/?ref=py_c
MSB-OS: http://www.magicschoolbook.com/computing/os-project - direct machine code programming
MSB-OS: http://www.magicschoolbook.com/computing/os-project - direct machine code programming