How to load the kernel from bootloader?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:How to load the kernel from bootloader?

Post by Solar »

beyond infinity wrote: *plonk* have you dared to smash your forehead onto the keyboard?
Traditionally, the sound it makes when a new entry is dropped into the killfile. ;-)
Every good solution is obvious once you've found it.
User avatar
bubach
Member
Member
Posts: 1223
Joined: Sat Oct 23, 2004 11:00 pm
Location: Sweden
Contact:

Re:How to load the kernel from bootloader?

Post by bubach »

I think i know what he wants, but he just wont listen to us..
In the FAT12.. thread we have a bootsector that loads a second stage loader, and in that second stage loader it loads the kernel.. FFS... All the things he need!
"Simplicity is the ultimate sophistication."
http://bos.asmhackers.net/ - GitHub
distantvoices
Member
Member
Posts: 1600
Joined: Wed Oct 18, 2006 11:59 am
Location: Vienna/Austria
Contact:

Re:How to load the kernel from bootloader?

Post by distantvoices »

vladaz, oh ye sinner, wilt thou forfeit some thoughts on that thing?

Nah, askin' questions is the eeeeasy way, but No, No, No, you will not get it spoon fed. I for one 've had to *learn* it by myself. It 'd have ashamed me to ask for info which can be researched.

*WHAM* (no, not early george michael thingses...)
... the osdever formerly known as beyond infinity ...
BlueillusionOS iso image
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:How to load the kernel from bootloader?

Post by Pype.Clicker »

just a fact:
you don't need a file system to load a kernel ... if you wrote your kernel so that it start on sector X and is N sectors-wide, you just have to read sectors X through X+N using the BIOS so that they go to the kernel's favourite location.
Vladaz

Re:How to load the kernel from bootloader?

Post by Vladaz »

Ok! I have the answer to my question, i think ;D .
I needed to load the kernel to memory from bootloader. One guy told me the manual about it. Thanks for help!
Vladaz

Re:How to load the kernel from bootloader?

Post by Vladaz »

Hmm. Now i have another problem ??? .
I have two files: bootsec.bin and kernel.bin .
bootsec.bin load kernel.bin to memory and execute.
But when i copy bootsec.bin to my floppy disk by
partcopy bootsec.bin 0 200 -f0
and kernel.bin by
partcopy kernel.bin 200 200 -f0
, then my bootloader(bootsec.bin) doesn't boots on my emulator. But when i copy only bootsec.bin, then it writes "Booting Blablabla OS......".
So how i need to copy those two files into floppy to work my OS without any errors?
Vladaz

Re:How to load the kernel from bootloader?

Post by Vladaz »

I forgot one more thing: bootsec.bin must be copied in first sector and kernel.bin in second sector of my floppy disk
User avatar
Neo
Member
Member
Posts: 842
Joined: Wed Oct 18, 2006 9:01 am

Re:How to load the kernel from bootloader?

Post by Neo »

Vladaz wrote: and kernel.bin by
partcopy kernel.bin 200 200 -f0
, then my bootloader(bootsec.bin) doesn't boots on my emulator.
i think you want partcopy kernel.bin 0 200 -f0 200 to write the kernel to the second sector. you cant write the file from source_offset 0x200 as you have.
Read the partcopy documentation you have for further details.
Only Human
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:How to load the kernel from bootloader?

Post by Solar »

That's the problem - he obviously doesn't like to do much reading himself. ::)
Every good solution is obvious once you've found it.
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:How to load the kernel from bootloader?

Post by Pype.Clicker »

alternatively, you can collate files together so that you'll do a single partcopy command:

Code: Select all

   copy /b bootsect.bin +kernel.bin allinone.bin
   partcopy whatever_relevant_options allinone.bin
Post Reply