Загрузка данных


int@mint:~/XirexOS$ cd ~/XirexOS && cat > Makefile <<'EOF'
BUILD=build
ISO=$(BUILD)/xirex-os.iso
KERNEL=$(BUILD)/kernel.bin

all: $(ISO)

$(BUILD):
        mkdir -p $(BUILD)

$(KERNEL): src/boot.asm src/kernel.c src/linker.ld | $(BUILD)
        nasm -f elf64 src/boot.asm -o $(BUILD)/boot.o
        gcc -m64 -ffreestanding -fno-stack-protector -fno-pie -mno-red-zone -nostdinc -c src/kernel.c -o $(BUILD)/kernel.o
        ld -nostdlib -z max-page-size=0x1000 -T src/linker.ld $(BUILD)/boot.o $(BUILD)/kernel.o -o $(KERNEL)

$(ISO): $(KERNEL) src/grub.cfg
        mkdir -p $(BUILD)/isodir/boot/grub
        cp $(KERNEL) $(BUILD)/isodir/boot/kernel.bin
        cp src/grub.cfg $(BUILD)/isodir/boot/grub/grub.cfg
        grub-mkrescue -o $(ISO) $(BUILD)/isodir

run: $(ISO)
make    rm -rf $(BUILD)_64 -cdrom $(ISO)
nasm -f elf64 src/boot.asm -o build/boot.o
gcc -m64 -ffreestanding -fno-stack-protector -fno-pie -mno-red-zone -nostdinc -c src/kernel.c -o build/kernel.o
src/kernel.c:1:20: error: no include path in which to search for stdint.h
    1 | #include <stdint.h>
      |                    ^
src/kernel.c: In function ‘kmain’:
src/kernel.c:5:14: error: unknown type name ‘uint16_t’
    5 |     volatile uint16_t* vga = (uint16_t*)0xB8000;
      |              ^~~~~~~~
src/kernel.c:5:31: error: ‘uint16_t’ undeclared (first use in this function)
    5 |     volatile uint16_t* vga = (uint16_t*)0xB8000;
      |                               ^~~~~~~~
src/kernel.c:1:1: note: ‘uint16_t’ is defined in header ‘<stdint.h>’; did you forget to ‘#include <stdint.h>’?
  +++ |+#include <stdint.h>
    1 | #include <stdint.h>
src/kernel.c:5:31: note: each undeclared identifier is reported only once for each function it appears in
    5 |     volatile uint16_t* vga = (uint16_t*)0xB8000;
      |                               ^~~~~~~~
src/kernel.c:5:40: error: expected expression before ‘)’ token
    5 |     volatile uint16_t* vga = (uint16_t*)0xB8000;
      |                                        ^
src/kernel.c:10:29: error: expected ‘)’ before numeric constant
   10 |         vga[i] = ((uint16_t)0x0F << 8) | text[i];
      |                  ~          ^~~~
      |                             )
make: *** [Makefile:12: build/kernel.bin] Error 1
mint@mint:~/XirexOS$