I'm learning C and learning to make an OS, but I'm finding it hard to learn due to C tutorials and info being hard to find. I'm also getting frustrated with all the libraries that are required, I read a lot of the posts and tried to accomplish them but my knowledge is very limited of C. I've managed to get a procedure called kprinf which is the nearest I can find to printf.
Does anyone have a skeleton of an OS which I can use to learn from the routines and the way in which eveything is initilized. I'm confused about the "IDT,GDT" thing, I've not found any info about it/them.
Ive also read the FAQ on this site and several other sources of information.
any info would be grately apreciated
does anyone have an OS skeleton?
Re: does anyone have an OS skeleton?
OS kernel skeleton? Check out the new Downloads section at Bona Fide OS Development:
http://surf.to/osdev
Finding little info about C? Try:
http://www.cprogramming.com
If you're looking for a book, then I highly recommend C by Example from QUE.
IDT and GDT. First, get the Intel 386 Programmer's Reference Manual:
http://www.execpc.com/~geezer/os/index.htm
Basically, you have 1 GDT and 1 IDT. The GDT holds several descriptors and the IDT holds addresses that point to Interrupt Service Routines(ISR).
Hopefully that helps,
K.J.
http://surf.to/osdev
Finding little info about C? Try:
http://www.cprogramming.com
If you're looking for a book, then I highly recommend C by Example from QUE.
IDT and GDT. First, get the Intel 386 Programmer's Reference Manual:
http://www.execpc.com/~geezer/os/index.htm
Basically, you have 1 GDT and 1 IDT. The GDT holds several descriptors and the IDT holds addresses that point to Interrupt Service Routines(ISR).
Hopefully that helps,
K.J.
Re: does anyone have an OS skeleton?
Thanks for the links, I'll have a propper read later.
however the link to your site redirected twice and couldnt find index.htm, so i just knocked off the index.htm bit from the url in the address bar. I downloaded kernel1.zip, kernel2.zip, and kernel3.zip which dont compile properly for some reason.
kernel.c give this error:
[glow=red,2,300]c:/djgpp/bin/ld.exe: warning: cannot find entry symbol start; defaulting to ff800000[/glow]
kernel2.c and kernel3.c give the same errors:
[glow=red,2,300]k_entry.asm:8: parser: instruction expected
k_entry.asm:25: symbol `gdt' redefined
k_entry.asm:42: invalid operand type
k_entry.asm:50: invalid operand type
k_entry.asm:60: operand 1: expression is not simple or relocatable[/glow]
I got the latest DJGPP and NASM/W and I used the kernbuild.bat to compile it.
Maybe you've encountered this problem?
however the link to your site redirected twice and couldnt find index.htm, so i just knocked off the index.htm bit from the url in the address bar. I downloaded kernel1.zip, kernel2.zip, and kernel3.zip which dont compile properly for some reason.
kernel.c give this error:
[glow=red,2,300]c:/djgpp/bin/ld.exe: warning: cannot find entry symbol start; defaulting to ff800000[/glow]
kernel2.c and kernel3.c give the same errors:
[glow=red,2,300]k_entry.asm:8: parser: instruction expected
k_entry.asm:25: symbol `gdt' redefined
k_entry.asm:42: invalid operand type
k_entry.asm:50: invalid operand type
k_entry.asm:60: operand 1: expression is not simple or relocatable[/glow]
I got the latest DJGPP and NASM/W and I used the kernbuild.bat to compile it.
Maybe you've encountered this problem?
Re: does anyone have an OS skeleton?
The first error that you report:
c:/djgpp/bin/ld.exe: warning: cannot find entry symbol start; defaulting to ff800000
isn't an error. The kernel compiles fine even though the compiler says this(try making gcc/djgpp output to the AOUT format instead of the default COFF).
Oops, those next errors are just mistakes that I made,
k_entry.asm:8: parser: instruction expected
change gdt [gdt_ptr] to lgdt [gdt_ptr]
Just do that and it should fix all of these errors:
k_entry.asm:25: symbol `gdt' redefined
k_entry.asm:42: invalid operand type
k_entry.asm:50: invalid operand type
k_entry.asm:60: operand 1: expression is not simple or relocatable
K.J.
c:/djgpp/bin/ld.exe: warning: cannot find entry symbol start; defaulting to ff800000
isn't an error. The kernel compiles fine even though the compiler says this(try making gcc/djgpp output to the AOUT format instead of the default COFF).
Oops, those next errors are just mistakes that I made,
k_entry.asm:8: parser: instruction expected
change gdt [gdt_ptr] to lgdt [gdt_ptr]
Just do that and it should fix all of these errors:
k_entry.asm:25: symbol `gdt' redefined
k_entry.asm:42: invalid operand type
k_entry.asm:50: invalid operand type
k_entry.asm:60: operand 1: expression is not simple or relocatable
K.J.
Re: does anyone have an OS skeleton?
Or you can go a download the ZIP files again(I just updated them)
Thanks for pointing out the error,
K.J.
Thanks for pointing out the error,
K.J.
Re: does anyone have an OS skeleton?
I know. My web host is switching to a different server right now.
If you want the ZIP file, just email me at [email protected] and I'll send it to you(and anyone else who wants it as well).
K.J.
If you want the ZIP file, just email me at [email protected] and I'll send it to you(and anyone else who wants it as well).
K.J.