What next?

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
Tehy

What next?

Post by Tehy »

Hi!

I have finally done some real code in my OS :) I only got this bootloader and I dont know what to do next. I hope someone could help me :)
[BITS 16]
[ORG 0x7C00]


main:
mov ax, 0x0000 ;Load ds register with current segment
mov ds, ax

mov si, String1 ;Write String1 to the screen
call PrintMsg

mov si, String2 ;Write String2 to the screen
call PrintMsg

jmp $


PrintMsg:
mov ah, 0x0E ;Teletype Mode
mov bh, 0x00 ;Page Number
.nextchar:
lodsb ;Load [si] into al and increment si
or al, al ;Set the Zero Flag if al = 0
jz .return ;If the Zero Flag is set, jump to Break
int 0x10 ;Call BIOS Video Function
jmp .nextchar ;Loop around to write next character
.return
ret ;Return


String1: db "Neg OS", 13, 10, 0
String2: db "Boot v.1.0", 0


times 510-($-$$) db 0 ;Loads of zeroes
dw 0xAA55 ;two last bytes
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:What next?

Post by Pype.Clicker »

any chance that in what order should i make things in? help ?

usually, setting up an environment that provide basic memory management, display stuff and support IRQs will help.

You may want to have ProtectedMode too ...
Presumably a guest

Re:What next?

Post by Presumably a guest »

Before you work on the things Pype mentioned, you'll probably want to provide the means to load something larger than 512 bytes (e.g. a file on a floppy) and transfer control to it, since I hardly believe you'll be able to do all the things you want to do in half a kilobyte.
Poseidon

Re:What next?

Post by Poseidon »

It may be handier to use in the beginning stage of your kernel a bootloader from someone else, I recommend GRUB. It supports lots of filesystems and a lot of executable formats as well.
AR

Re:What next?

Post by AR »

Or more accurately, it supports ELF and has a hack to support almost any other executable format. I recommend GRUB as well but I learned a lot from messing with a bootloader before I switched to GRUB though.
Tehy

Re:What next?

Post by Tehy »

Ok thanks for all :)
Tehy

Re:What next?

Post by Tehy »

I decided start to use GRUB but I dont know how GRUB works. Can GRUB load my kernel in hardrive?
AR

Re:What next?

Post by AR »

GRUB Documentation

You can also get an empty GRUB disk image from Pype's site (here - miscellaneous section)
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:What next?

Post by Pype.Clicker »

Tehy wrote: I decided start to use GRUB but I dont know how GRUB works. Can GRUB load my kernel in hardrive?
sure it can! just tell what partition (e.g. hd0(2)) and what file in that partition et voil?. consider using the GRUB command line feature ...

It can even download the image from the network and boot it if asked politely enough ;)
Post Reply