Code: Select all
nasm stub.asm -f win32 -o stub.o
gcc.exe -w -O -fstrength-reduce -fomit-frame-pointer -finline-functions -nostdinc -fno-builtin -I../inc -c -o main.o main.c
gcc.exe -w -O -fstrength-reduce -fomit-frame-pointer -finline-functions -nostdinc -fno-builtin -I../inc -c -o screen.o screen.c
gcc.exe -w -O -fstrength-reduce -fomit-frame-pointer -finline-functions -nostdinc -fno-builtin -I../inc -c -o gdt.o gdt.c
gcc.exe -w -O -fstrength-reduce -fomit-frame-pointer -finline-functions -nostdinc -fno-builtin -I../inc -c -o idt.o idt.c
ld.exe -T "C:\documents and settings\OIB\Desktop\os\link.ld" -o OIBKRNL.EXE stub.o idt.o gdt.o screen.o main.o
pause
Code: Select all
idt.o:idt.c:(.text+0x5d): undefined reference to `_idt_load'
gdt.o:gdt.c:(.text+0xa0): undefined reference to `_gdt_flush'
Now if I try using visual studio, I get an error from MASM on my two functions to read and write ports:
Code: Select all
//use for reading from I/O ports
unsigned char inportb (unsigned short _port)
{
unsigned char rv;
_asm {
in rv, _port
}
return rv;
}
//use for writing to I/O ports
void outportb (unsigned short _port, unsigned char _data)
{
_asm {
out _port, _data
}
return;
}