Code: Select all
/tmp/ccJhBB1d.s: Assembler messages:
/tmp/ccJhBB1d.s:12: Error: bad register name `%rbp'
/tmp/ccJhBB1d.s:15: Error: bad register name `%rsp'
/tmp/ccJhBB1d.s:17: Error: bad register name `%rsp'
/tmp/ccJhBB1d.s:20: Error: bad register name `%rbp)'
/tmp/ccJhBB1d.s:33: Error: bad register name `%rbp'
/tmp/ccJhBB1d.s:36: Error: bad register name `%rsp'
/tmp/ccJhBB1d.s:39: Error: bad register name `%rbp)'
/tmp/ccJhBB1d.s:40: Error: bad register name `%rbp)'
/tmp/ccJhBB1d.s:48: Error: bad register name `%rbp'
Code: Select all
gcc -nostdinc -fno-builtin -fno-unit-at-a-time -I./include -c -o src/kernel.o src/kernel.c
ld -Ttext=0x0 -o src/stage2.sys src/kernel.o -e _kernel_entry
Code: Select all
asm (".code16gcc\n");
void putc (char c);
int kernel_entry {
putc ('t');
return 0;
}
void putc (char c) {
asm ("movb %0, %%al\n"
"movb $0x0e, %%ah\n"
"int $0x10\n"
:
: "r"(c));
}
I know this is basic stuff but I am new to gcc/gas syntax for assembly. Really I know what im talking about I just don't know much about what is going on here!!! Thanks in advance for whoever answers my question guys!! Oh btw it is always great to join a new forum!!!