Commit initial
This commit is contained in:
19
test/init/Makefile
Normal file
19
test/init/Makefile
Normal file
@ -0,0 +1,19 @@
|
||||
.PHONY: clean
|
||||
|
||||
CC=gcc
|
||||
CFLAGS=-m32 -march=i486 -fno-zero-initialized-in-bss
|
||||
|
||||
LINKER=ld
|
||||
LDFLAGS=-melf_i386 -Ttext=10000000 --entry=main
|
||||
|
||||
all: init
|
||||
|
||||
init: init.o
|
||||
$(LINKER) $(LDFLAGS) $^ -o $@
|
||||
|
||||
|
||||
%.o: %.c
|
||||
$(CC) $(CFLAGS) -c $^ -o $@
|
||||
|
||||
clean:
|
||||
-rm -f *.o init
|
12
test/init/init.c
Normal file
12
test/init/init.c
Normal file
@ -0,0 +1,12 @@
|
||||
void main()
|
||||
{
|
||||
char *msg1 = "NutsOS Init program\n";
|
||||
|
||||
while(*msg1 != 0)
|
||||
{
|
||||
asm("mov $1, %%eax; mov %0, %%ebx; int $0x40" :: "m"(msg1));
|
||||
msg1++;
|
||||
}
|
||||
|
||||
asm("mov $5, %eax; int $0x40");
|
||||
}
|
Reference in New Issue
Block a user