New to OS dev...
New to OS dev...
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
- 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
Re:New to OS dev...
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
Sion
Re:New to OS dev...
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
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
Re:New to OS dev...
Thanks for the response adeelmahmood1 and for your help ill try both but i have to agree with you.
Thanks again Sion
Thanks again Sion
Groovyweb? EasyOS?
::) ::) 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
Thx
Re:New to OS dev...
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...
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:New to OS dev...
Yo!! Go get it @ http://www.groovyweb.uklinux.net/index.php?page_name=how%20to%20write%20your%20own%20os! Get the most reliable version.Pype.Clicker wrote: sion: br0ken link (the .zip isn't there anymore)
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??
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:New to OS dev...
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 ...)
Re:New to OS dev...
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!!!
Memories, Memories!!!
Re:New to OS dev...
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...Therx wrote:it's so easy to compile under windows.