Make it GCC compatible.

This commit is contained in:
bʰedoh₂ swé 2024-10-20 02:20:00 +05:00
parent 73611cde09
commit e4294e3454
2 changed files with 4 additions and 5 deletions

1
README
View File

@ -1,2 +1 @@
MBR boot sector Hello world written in C.
Note: this thing does not work with GCC.

8
boot.c
View File

@ -1,5 +1,5 @@
inline void putchar(char);
inline void write(char*);
static void putchar(char);
static void write(char*);
void _start(void) {
write("Hello World!\r\n\0");
@ -7,12 +7,12 @@ void _start(void) {
;
}
inline void write(char *out) {
static void write(char *out) {
for (char *i = out; *i != 0; i++)
putchar(*i);
}
inline void putchar(char out) {
static void putchar(char out) {
__asm__ volatile (
"movb $0x0e, %%ah;"
"movb %0, %%al;"