Real mode kernel within a bootloader

Discussions on more advanced topics such as monolithic vs micro-kernels, transactional memory models, and paging vs segmentation should go here. Use this forum to expand and improve the wiki!
User avatar
VolTeK
Member
Member
Posts: 815
Joined: Sat Nov 15, 2008 2:37 pm
Location: The Fire Nation

Real mode kernel within a bootloader

Post 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
JohnnyTheDon
Member
Member
Posts: 524
Joined: Sun Nov 09, 2008 2:55 am
Location: Pennsylvania, USA

Re: Real mode kernel within a bootloader

Post 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.
User avatar
VolTeK
Member
Member
Posts: 815
Joined: Sat Nov 15, 2008 2:37 pm
Location: The Fire Nation

Re: Real mode kernel within a bootloader

Post 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
mrnoob
Member
Member
Posts: 26
Joined: Thu Sep 18, 2008 11:45 am

Re: Real mode kernel within a bootloader

Post 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.
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Re: Real mode kernel within a bootloader

Post by Dex »

User avatar
VolTeK
Member
Member
Posts: 815
Joined: Sat Nov 15, 2008 2:37 pm
Location: The Fire Nation

Re: Real mode kernel within a bootloader

Post 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
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Re: Real mode kernel within a bootloader

Post 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.
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

Re: Real mode kernel within a bootloader

Post 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!
Image
Image
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
I wish I could add more tex
User avatar
VolTeK
Member
Member
Posts: 815
Joined: Sat Nov 15, 2008 2:37 pm
Location: The Fire Nation

Re: Real mode kernel within a bootloader

Post 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
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: Real mode kernel within a bootloader

Post 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.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Re: Real mode kernel within a bootloader

Post 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
User avatar
VolTeK
Member
Member
Posts: 815
Joined: Sat Nov 15, 2008 2:37 pm
Location: The Fire Nation

Re: Real mode kernel within a bootloader

Post 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.
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

Re: Real mode kernel within a bootloader

Post 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?
Image
Image
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
I wish I could add more tex
User avatar
VolTeK
Member
Member
Posts: 815
Joined: Sat Nov 15, 2008 2:37 pm
Location: The Fire Nation

Re: Real mode kernel within a bootloader

Post by VolTeK »

now what if some of the code is a part of what is in a tut from broken thorn?
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

Re: Real mode kernel within a bootloader

Post by Troy Martin »

If you can optimize it or change it, then I guess it could be classified as your code.
Image
Image
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
I wish I could add more tex
Post Reply