Page 1 of 2
Real mode kernel within a bootloader
Posted: Sun Dec 28, 2008 9:06 pm
by VolTeK
what if someone were to form a bootloader, to a kernel or os all in a bootloader, use a cli to run a file using the fat with the bootloader and run whats in the buffer from the cli. is that possible or are there things i am missing? if it is possible, i want to try it, oh and since the files names on one or all of the fat's only have 11 letter files names (8.3) make the buffer only big enough to hold 11 letters. i hope what i said is understandable, im not very good with describing whats on my mind. but any way, if so tell me, and i will try to reform my bootloader for my os, or find bootprog, and try it
Re: Real mode kernel within a bootloader
Posted: Sun Dec 28, 2008 9:30 pm
by JohnnyTheDon
Uh, if I'm correctly interpreting your question, yes, you could make a real mode kernel and have it use BIOS interrupts to access a file on the hard drive. As for putting the kernel IN the bootloader, its possible but be aware only the first 512 bytes of your kernel will be loaded by the BIOS. The rest you will have to load yourself.
Re: Real mode kernel within a bootloader
Posted: Sun Dec 28, 2008 9:38 pm
by VolTeK
thanks for the answer, dont worry, getting that little bit in will be easy to fit is just 512, but i willl have to test how big the bootloader is with out the padding to see how much space i have left for the little bit, when i get it done, i will try to get a download here, if not, eh it was a try, i will learn as i go
Re: Real mode kernel within a bootloader
Posted: Mon Dec 29, 2008 8:29 am
by mrnoob
from what it sounds like, youve basically described the bootloader's function anyway. It does some simple setup and loads the rest of the kernel into memory, then executes it.
Re: Real mode kernel within a bootloader
Posted: Mon Dec 29, 2008 10:13 am
by Dex
Re: Real mode kernel within a bootloader
Posted: Mon Dec 29, 2008 2:49 pm
by VolTeK
oh wait i just had a thought, if someone were to type a 4 letter name or 4.3 they would have to space i think i dont kno where but they would so, if this is possible, it wont be sucsessful but it would be a very portable 512 byte dos, no extras but all in one, boots (alittle actuall not at all) the cli will be just input with no internal commands, only runs anything that is outside of the program. but if i can find a way of how the loading process works, and learn how to pad wherer it is needd then i will get back to you dex, it cant beat you minidos because, mindos is small and does alot more than this small test
Re: Real mode kernel within a bootloader
Posted: Mon Dec 29, 2008 7:38 pm
by Dex
Onething that MiniDos does that is simular, is it re-user's the bootloader code eg: 512 boot sector to load a user program off the floppy that is typed in from the CLI.
Here some 512byte OS to show what can be done
http://www.dex4u.com/ASMcompo512b
Theres multi-tasking OS, debugs, games, 32bit pmode OS with vesa gui and cd player etc all fit in 512byte boot sector.
Re: Real mode kernel within a bootloader
Posted: Mon Dec 29, 2008 8:59 pm
by Troy Martin
Dex: Those OSes are real nifty, where did you find them all??
OP: I've done a small CLI in a boot sector, granted it can't load anything, but it's a small little kernel in 512 bytes with over a hundred to spare!
Re: Real mode kernel within a bootloader
Posted: Mon Dec 29, 2008 10:39 pm
by VolTeK
well, i will have to try it for my self, but will take your word for it. i still have to get my bootloaderto load my second stage (im looking at brokenthorn tut 3 and 4 booloaders really nifty! i am going to use some of it (hope full not all of it, i know how it all works, but i cant seem to remember every bit of it) thats ok right, if not i will take much more time looking at it, i think it seems wrong. so far its my 4th time looking at the same tut trying to remember or get the whole idea of it
@dex the link of os you gave me are interesting thanks, but yes what you said is what i was trying to do, now if that is possible which it is, no os can get smaller than that!!!! well, if so, it cant be booted
Re: Real mode kernel within a bootloader
Posted: Tue Dec 30, 2008 2:43 am
by Love4Boobies
What I got from your post is that you're looking into making a bootloader that loads a kernel from a CLI. GRUB can do that for you, but it won't work for real mode kernels. As I've noted on another thread, there is a small OS called
Atomic Os that only occupies one sector and runs in real mode.
Re: Real mode kernel within a bootloader
Posted: Tue Dec 30, 2008 11:32 am
by Dex
Troy Martin wrote:Dex: Those OSes are real nifty, where did you find them all??
OP: I've done a small CLI in a boot sector, granted it can't load anything, but it's a small little kernel in 512 bytes with over a hundred to spare!
We had a 512byte compo on the fasm forum many moons a go and they where some of the entrys, i came second
, i was called ASHLEY4 then and my entry was CdPod, maybe we could have another one here ?
See here:
http://board.flatassembler.net/topic.php?t=2164
Re: Real mode kernel within a bootloader
Posted: Tue Dec 30, 2008 12:06 pm
by VolTeK
hey that sounds like a plan, maybe the competition can be held or started the day after tommarow, ihave to get something ready, or tommarow, i do have all night
update on the tuts i was reading, through the cr4 register we can use int's through pmode, or wait... we can use int's but the bios ones? or am i wrong? if not whats the point we are making drivers for all of this.
Re: Real mode kernel within a bootloader
Posted: Tue Dec 30, 2008 12:11 pm
by Troy Martin
I'd join up. I'd have fun with this. We should lay down some rules though:
- Real mode
- Must be your own code
- MUST fit in 512 bytes (including 0x55 0xAA)
- You don't need to keep the filesystem intact
- Must have some kind of interface
EDIT: Anyone heard of the
IOCCC?
Re: Real mode kernel within a bootloader
Posted: Tue Dec 30, 2008 12:23 pm
by VolTeK
now what if some of the code is a part of what is in a tut from broken thorn?
Re: Real mode kernel within a bootloader
Posted: Tue Dec 30, 2008 1:01 pm
by Troy Martin
If you can optimize it or change it, then I guess it could be classified as your code.