Why doesnt my print function work?
Posted: Thu Dec 01, 2022 6:33 pm
I'm following Daedalus Community's [url="https://www.youtube.com/watch?v=EpFUzjYehxs"]Making an OS (x86)[/url] tutorial.
Ive gotten to chapter 7, where you start writing the kernel in C. I'm trying to program a print function, but it doesn't work... And the stack trace doesn't give a clue...
Theres only one error.
Here's the code:
I'm definitely a beginner, so this may just be a stupid mistake.
Any help would be appreciated, Thanks.
Ive gotten to chapter 7, where you start writing the kernel in C. I'm trying to program a print function, but it doesn't work... And the stack trace doesn't give a clue...
Theres only one error.
Code: Select all
kernel.c:31: undefined reference to `_GLOBAL_OFFSET_TABLE_'
Here's the code:
Code: Select all
void print(char text[]) {
unsigned int i = 0;
unsigned int addr = 753664; // 0xb8000 in hex
while (text[i] != 0) {
*(char*)addr = text[i];
i+=1;
addr+=2;
}
return;
}
extern void main() {
print("test");
return;
}
Any help would be appreciated, Thanks.