Make it GCC compatible.
This commit is contained in:
parent
73611cde09
commit
e4294e3454
1
README
1
README
@ -1,2 +1 @@
|
||||
MBR boot sector Hello world written in C.
|
||||
Note: this thing does not work with GCC.
|
||||
|
8
boot.c
8
boot.c
@ -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;"
|
||||
|
Loading…
Reference in New Issue
Block a user