What now?

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.
Post Reply
f2

What now?

Post by f2 »

I've written the bootloader (located in teh bootsector) that pretty much just prints out a message to the screen.  Now, I'm trying to make the bootloader load the bootstrap to do whatever is needed without a 510 bytes limit.  So, what is needed to be done in the bootstrap?  Open the A20 gate?  Select a file system (how is this done?)?  Load the kernel?

Thanks!
bchadwick01

Re: What now?

Post by bchadwick01 »

Tommy,
  I'm guessing that you're using at least a little, if not all assembler?  If so you should check on disk routines from the BIOS services (INT 0x13), here's a link to some stuff (http://www.iro.umontreal.ca/~feeley/cou ... int13.html)
  You can use that to read from your disk, floppy or otherwise, then you have to choose your file system.  If you're using floppies on Windows, I suggest looking at Vnutz page (http://www.geocities.com/mvea/bootstrap.htm).  THis is a great Fat12 (Windows/DOS floppy format) bootsector that loads a binary file and jumps to it. Just edit the needed constants (like the OS filename), or rewrite as you wish, assemble it, and write it to the first sector of a DOS formatted floppy. Then you can build you're OS into a plain binary file and put it on the floppy for loading. It saves a lot of time if you can just drag you're OS files instead of waisting formatted disks.
  Hope that helps a little,

  BC
f2

Re: What now?

Post by f2 »

Yeah, I don't think I'm choosing my file system.  For now, I'm using interrupt 13 and loading from a certain sector, track, head.  I'm going to specifically put the bootstrap into a sector, track, and head that I know so I can set up for the interrupt to BIOS.  That's how I'm going to load the bootstrap.

But my question is: What is needed to be done in the bootstrap?  I listed a couple of things in the first post of this thread.  Anything else?  How?
bchadwick01

Re: What now?

Post by bchadwick01 »

 Basically what you have to do depends on what you want to do with your OS. The least that needs to be done is load your OS file/sectors from disk and jmp to them.
 If you want to get into protected mode, then you need to check for a 386, setup a gdt and enable A20 before you switch (change CR0), and jump to your new cod segment descriptor, but all that can be done in your main OS file instead of your bootstrap if you want.  Once in pmode you can't use the bios ints, so you might want to do all your loading from real mode, unless you're going to write a disk driver.  Eventually you'll probably want to setup an IDT and move the hardware interrupts to a different vector number.  
 Otherwise you could just use the bios interrupts and functions and stay in real mode and have some fun with the graphics modes or something (INT 0x10). It's really up to you.
good luck.
BC
f2

Re: What now?

Post by f2 »

Where's the best site to learn about IDTs, writing my own disk driver, etc.?  I would like to really study this and then do this all manually.
K.J.

Re: What now?

Post by K.J. »

Tommy said:
Where's the best site to learn about IDTs, writing my own disk driver, etc.?  I would like to really study this and then do this all manually.

Well... there isn't one. :(
You could download Chris Giese's OSD sample kernels for IDT info:
http://www.execpc.com/~geezer/osd/code/osd.zip

As for what your bootstrap should do, it deepends on whether or not you are making a protected or real mode OS. For a PMode OS, you should enable the A20, set up a GDT, switch to PMode(you don't need to check for a 386), and load your kernel and run it. For a real mode OS, just load the kernel and run it.

Hope that helps,
K.J.
f2

Re:What now?

Post by f2 »

Yeah, I think I know what I need now. How about choosing or making a file system? Where do you choose one?

I started a thread asking about opening the A20 gate and your answer would be greatly appreciated if you could go to that thread and I could have your input
virtus

Re:What now?

Post by virtus »

What filesystem to choose is up to you, you could code your own, but alot of people tend to use FAT..
It's your choice.. Coding your own could be phun too ;)
f2

Re:What now?

Post by f2 »

I'm really thinking about coding my own. I'm not sure for the first version of my OS, but I will definitely do it in teh future.

Expect a thread asking about it ;)
K.J.

Re:What now?

Post by K.J. »

A very simple filesystem(BadFS) can be found with the LR-OS source code:
http://www22.brinkster.com/badsector/lros/

K.J.
f2

Re:What now?

Post by f2 »

I'll take a look at it. Is the source code in NASM (Netwide Assembly), by any chance? I'm programming the WHOLE operating system in pure NASM.
K.J.

Re:What now?

Post by K.J. »

Yes, the ENTIRE source is NASM.

K.J.
Post Reply