i need help for interrupts..
i need help for interrupts..
sory about my english..
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?
thanks for ur help...
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?
thanks for ur help...
Re:i need help for keyboard...
I think I'll let the first 2 points to someone else....
For loading these tables however you'll need _at least_ a single instruction in inline-asm, since you need special opcodes for these.
cheers
Joe
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.trashmanso wrote: 3.can i write irq,idt,gdt etc... codes in c? or i have to use asm?
For loading these tables however you'll need _at least_ a single instruction in inline-asm, since you need special opcodes for these.
cheers
Joe
Re:i need help for keyboard...
thank u for ur answer. can i call an asm code from c, like a function? ( a linked *.asm code )
Re:i need help for keyboard...
and also i need the first and the second questions answers.. .D
thanks.
thanks.
Re:i need help for keyboard...
Hi,
For simple/small things it's usually much better to use inline assembly.
Cheers,
Brendan
Yes, but the exact details might depend on which compiler you're using.trashmanso wrote:thank u for ur answer. can i call an asm code from c, like a function? ( a linked *.asm code )
For simple/small things it's usually much better to use inline assembly.
trashmanso wrote: and also i need the first and the second questions answers.. .D
Have you tried this page about keyboards (which does use C examples)?trashmanso wrote:1. i cant use keyboard. i dont know asm and all codes are in asm about keyboard. are there any c source?
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....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?
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.
Re:i need help for keyboard...
i've done a little project..
i only writes on screen in 32pmode and enables a20... and i stucked...
the problem is:
but i know there is a start.o file and also not empty..
My bıild.bat file
and i cant use Interrupt? i have searched lots of tutorials and also http://osdever.net/tutorials/interrupts.1.php?the_id=39 but i dont understand all.
where should i add irq,isr code? (in my bootf.asm or loader.asm)
pause
i only writes on screen in 32pmode and enables a20... and i stucked...
the problem is:
Code: Select all
start.o : file not recognized: File format not recognized
My bıild.bat file
Code: Select all
nasm -f aout -o start.o start.asm
d:\mingw\bin\gcc -Wall -O -fstrength-reduce -fomit-frame-pointer -finline-functions -nostdinc -fno-builtin -I./include -c -o main.o main.c
d:\mingw\bin\gcc -Wall -O -fstrength-reduce -fomit-frame-pointer -finline-functions -nostdinc -fno-builtin -I./include -c -o scrn.o scrn.c
d:\mingw\bin\gcc -Wall -O -fstrength-reduce -fomit-frame-pointer -finline-functions -nostdinc -fno-builtin -I./include -c -o gdt.o gdt.c
d:\mingw\bin\gcc -Wall -O -fstrength-reduce -fomit-frame-pointer -finline-functions -nostdinc -fno-builtin -I./include -c -o idt.o idt.c
d:\mingw\bin\gcc -Wall -O -fstrength-reduce -fomit-frame-pointer -finline-functions -nostdinc -fno-builtin -I./include -c -o isrs.o isrs.c
d:\mingw\bin\gcc -Wall -O -fstrength-reduce -fomit-frame-pointer -finline-functions -nostdinc -fno-builtin -I./include -c -o irq.o irq.c
d:\mingw\bin\gcc -Wall -O -fstrength-reduce -fomit-frame-pointer -finline-functions -nostdinc -fno-builtin -I./include -c -o timer.o timer.c
d:\mingw\bin\gcc -Wall -O -fstrength-reduce -fomit-frame-pointer -finline-functions -nostdinc -fno-builtin -I./include -c -o kb.o kb.c
d:\mingw\bin\ld -T link.ld -o kernel.bin start.o main.o scrn.o gdt.o idt.o isrs.o irq.o timer.o kb.o
and i cant use Interrupt? i have searched lots of tutorials and also http://osdever.net/tutorials/interrupts.1.php?the_id=39 but i dont understand all.
where should i add irq,isr code? (in my bootf.asm or loader.asm)
pause
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:i need help for keyboard...
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.trashmanso wrote: i've done a little project..
i only writes on screen in 32pmode and enables a20... and i stucked...
the problem is:but i know there is a start.o file and also not empty..Code: Select all
start.o : file not recognized: File format not recognized
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.
Re:i need help for keyboard...
i 've changed my build.bat but know the problem is
and i also installed cygwin on my pc. but i dont know how can i use it. i cant find gcc under cygwin...
thanks
Code: Select all
PE operations on non PE file.
thanks
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:i need help for interrupts..
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.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.
That's typical from an attempt to produce an ELF file with cygwin's linker...PE operations on non PE file.
Re:i need help for interrupts..
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 .
thanks again.
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 .
thanks again.
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:i need help for interrupts..
well, just pick more packages to install. no need to undo what's already been done.trashmanso wrote: i think i should install cygwin again because there is no gcc file in usr/bin....
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.
Re:i need help for interrupts..
where can i download gcc and how? am i have to download clibs..
Re:i need help for interrupts..
During the Cygwin installation you can choose a custom setup option which will let you choose what you want to install.