New to OS dev...

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
sion

New to OS dev...

Post by sion »

First of i'd like to say hello to everyone. I just recently became interested in OS dev. and assembly. I have started trying to write my own os from scratch just to learn more about computers and os's themselves. My question is; i've done alot of research and studied alot of different bootloaders and kernels, and I've noticed that mainly there are two different ways of loading the kernel:

- have it written to a sector on a floppy and then loaded to memory [ES:BX] then jmp to it.
- have the .bin file on the disk itself search the floppy and load it. For example: EasyOS, and EduOS

I have several questions about this.
1. What is the best way to load a kernel to actually look for it, due to the fact theres less chance for a mistake or just to have it written to a disk and then just jump to it. 2. All the examples that use the loading the kernel to memory like (http://www.geocities.com/groovydbphp/assembler.htm) and PolyOne OS. i don't know how to write the kernel to the floppy sector. I use debug :: w 100 0 0 1 to write the bootsector, but how do i write the kernel.

Maybe im missing somthing, or not properly understanding sectors. Any help would be great. Thanks, Sion
sion

Re:New to OS dev...

Post by sion »

Ok i did a search on the forum and found a whole load of questions just like this one on using partcopy and such so sorry for the repeat question. But i'd still like to hear what the better of the two is. Either writing straight to memory using partcopy or to copy the kernel to the disk and find it using the bootloader.
Sion
adeelmahmood1

Re:New to OS dev...

Post by adeelmahmood1 »

well loading the kernel in the floppy sectors and then into the memory is definately a better idea .. so how u can do that
u should have a bootloader which might be boot.asm
and a kernel which might be kernel.c
now make the binary files out of them, boot.bin and kernel.bin suppose ur kernel.bin is 800 bytes and boot.bin is ofcourse 512 bytes so just use partcopy to copy them to floppy sectors

:> partcopy boot.bin 0 200 -f0 0
this will copy boot.bin from offset '0' to offset '200' (dec 512) to the floppy starting at offset '0'

:> partcopy kernel.bin 0 320 -f0 200
this will copy kernel.bin from offset '0' to offset '320' (dec 800) to the floppy starting at offset '200' coz first 200 are occupied by the boot loader

thats it now just read the kernel in the memory
hope that helps
sion

Re:New to OS dev...

Post by sion »

Thanks for the response adeelmahmood1 and for your help ill try both but i have to agree with you.
Thanks again Sion
Mastermind

Groovyweb? EasyOS?

Post by Mastermind »

::) ::) What is easy os? Does it use real mode or protected mode? Because if it's a pmode os, I might want to check it out...
Thx
sion

Re:New to OS dev...

Post by sion »

EasyOS was part of the groovyweb's tutorial on writing the beg. stages of an OS (http://www.groovyweb.uklinux.net/index. ... ame=easyos)...It is a real mode os...I'd upload it but its past the limit well over 30kb...but if you do a search on google im sure you could find it...hope that helps...
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:New to OS dev...

Post by Pype.Clicker »

sion: br0ken link (the .zip isn't there anymore)
Mastermind

Re:New to OS dev...

Post by Mastermind »

Pype.Clicker wrote: sion: br0ken link (the .zip isn't there anymore)
Yo!! Go get it @ http://www.groovyweb.uklinux.net/index.php?page_name=how%20to%20write%20your%20own%20os! Get the most reliable version.

Also, I've checked out the src of the prgm. Yeah, it's rmode (16 bits). I'm thinking about porting some functions to my pmode os. Would they work??
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:New to OS dev...

Post by Pype.Clicker »

unlikely ... you'll find it easier to port from other 32 bits mode OSes like cosmos (from geezer), mobius (from Tim Robinson), newos (the basis of openBeOS ...)
Therx

Re:New to OS dev...

Post by Therx »

Ah, that real mode OS was my first ever attempt at an OS. I worked on it with the owner of How-to.tk. I've come across many projects which change the name and claim it as their own. I don't know why its so popular. I guess its because it's so easy to compile under windows. I wouldn't recommend it. It's a bit of an untidy, quick-fix, cut'n'paste, out-of-date OS.

Memories, Memories!!!
Mastermind

Re:New to OS dev...

Post by Mastermind »

Therx wrote:it's so easy to compile under windows.
This was the reason I considered using EasyOS... I just needed a very simple, efficient, and small run()... I guess I'd have to port it from a 32bit OS...
Post Reply