kernel.c: changed colors, Makefile: updated output
This commit is contained in:
parent
8494925192
commit
084fb8a203
20
Makefile
20
Makefile
@ -4,9 +4,23 @@ LDFLAGS= -melf_i386 -nostdlib -e loader -T link.ld
|
|||||||
OBJS=kernel.bin
|
OBJS=kernel.bin
|
||||||
|
|
||||||
all: $(OBJS)
|
all: $(OBJS)
|
||||||
|
|
||||||
kernel.bin: loader.o kernel.o
|
kernel.bin: loader.o kernel.o
|
||||||
$(LD) $(LDFLAGS) $^ -o $@
|
@echo " LD kernel.bin"
|
||||||
|
@$(LD) $(LDFLAGS) $^ -o $@
|
||||||
|
|
||||||
install:
|
install:
|
||||||
cp ./kernel.bin /boot/mykernel.bin
|
@echo " CP kernel.bin"
|
||||||
|
@cp ./kernel.bin /boot/mykernel.bin
|
||||||
|
|
||||||
|
%.o: %.c
|
||||||
|
@echo " CC $@"
|
||||||
|
@$(CC) $(CFLAGS) -c $^
|
||||||
|
|
||||||
|
%.o: %.s
|
||||||
|
@echo " AS $@"
|
||||||
|
@$(AS) $(ASFLAGS) -c $^ -o $@
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) *.o kernel.bin
|
@echo " RM *.o kernel.bin"
|
||||||
|
@$(RM) *.o kernel.bin
|
||||||
|
2
kernel.c
2
kernel.c
@ -3,7 +3,7 @@ void puts(char*s)
|
|||||||
{
|
{
|
||||||
static unsigned short*vram=(unsigned short*)0xb8000;
|
static unsigned short*vram=(unsigned short*)0xb8000;
|
||||||
for(int i=0;s[i];++i)
|
for(int i=0;s[i];++i)
|
||||||
vram[i]=(vram[i]&0xff00)|s[i];
|
vram[i]=0x1f00|s[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
void kernelmain(void*multiboot_structure,unsigned magicnumber)
|
void kernelmain(void*multiboot_structure,unsigned magicnumber)
|
||||||
|
Loading…
Reference in New Issue
Block a user