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.
i have started my first project... i have loaded my kernel but there are a lot of problems...
1. i cant use keyboard. i dont know asm and all codes are in asm about keyboard. are there any c source?
2. when i include a header to my kernel.c gcc compiles is well but my linker always creates problem. what should i do?
3.can i write irq,idt,gdt etc... codes in c? or i have to use asm?
I think I'll let the first 2 points to someone else....
trashmanso wrote:
3.can i write irq,idt,gdt etc... codes in c? or i have to use asm?
The code for creating and manipulating the gdt/ldt and idt can be written in C, no problem. Just create a struct (or class, in C++) for the appropriate descriptor types, and treat the descriptor table as an array of descriptors.
For loading these tables however you'll need _at least_ a single instruction in inline-asm, since you need special opcodes for these.
trashmanso wrote:2. when i include a header to my kernel.c gcc compiles is well but my linker always creates problem. what should i do?
That depends on what the problem is - if it's something like "can't create file - not enough free space on disk" it shouldn't be hard to fix, but if you don't tell us what the problem is we could be guessing for months....
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
start.o : file not recognized: File format not recognized
but i know there is a start.o file and also not empty..
That comes from a mismatch between your linker and your assembler output format. "nasm -hf" should tell you what output formats your assembler supports. In your case, "win32" might be the one you need.
Be aware, too, that mingw may be poorly suited to os development (though there are certainly workarounds for all the troubles you might encounter), so you might want to use cygwin instead, and even maybe building a cross-compiler, depending on your specific needs.
The Root Directory for Cygwin (default C:\cygwin) will become / within your Cygwin installation. You must have write access to the parent directory, and any ACLs on the parent directory will determine access to installed files.
If you have installed gcc with cygwin, it should thus appear in "/usr/bin/gcc" once in the cygwin shell or in "c:\cygwin\usr\bin\gcc" when in the MS shell/explorer/whatever.
PE operations on non PE file.
That's typical from an attempt to produce an ELF file with cygwin's linker...
i think i should install cygwin again because there is no gcc file in usr/bin....
i need i good tutorial which i can compile easly in windows. i have downloaded lots of(about 50) but every of them gives errors while compiling. can u give me a tutorial like that. (print on screen, keyboard, irq,idt,gdt,pic etc...) maybe a need a small kernel source for learning..
can i reed "makefile"'s with cygwin with no problem .
trashmanso wrote:
i think i should install cygwin again because there is no gcc file in usr/bin....
well, just pick more packages to install. no need to undo what's already been done.
can i reed "makefile"'s with cygwin with no problem .
If you install "gnu make", probably ... unless the makefile contains something that's very unix-specific ... Just running "make" in the directory that contains the makefile should do the trick.