From 25c2ec0fbf011b429499246b47c4aeefb7513cc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Thu, 27 Sep 2018 17:32:25 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20correction=20pour=20d=C3=A9marrage=20san?= =?UTF-8?q?s=20GRUB/multiboot?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- makefile | 6 +++--- system/system.c | 13 ++++++++----- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/makefile b/makefile index 03cdc97..8d3c248 100755 --- a/makefile +++ b/makefile @@ -2,11 +2,11 @@ all: bits32 bits64 floppy harddisk uefi sync bits32: ARCH=bits32 -bits32: lib/libs.o system/system.sys harddisk +bits32: lib/libs.o system/system.sys sync bits64: ARCH=bits64 -bits64: lib/libs.o system/system.sys uefi +bits64: lib/libs.o system/system.sys sync floppy: boot/boot12.bin final/floppy.img.final @@ -48,7 +48,7 @@ retest: littleclean test retest64: littleclean test64 -floppytest: floppy qemu-floppy +floppytest: bits32 floppy qemu-floppy view: (hexdump -C ./final/harddisk.img.final|head -c10000) diff --git a/system/system.c b/system/system.c index db734ea..079476f 100755 --- a/system/system.c +++ b/system/system.c @@ -45,17 +45,20 @@ int main(unsigned long magic, unsigned long addr) cli(); setvmode(0x02); /* Efface l'ecran */ - if (magic != MULTIBOOT2_BOOTLOADER_MAGIC) - { - printf ("Nombre magic inconnu: 0x%x\n", (u32) magic); - return; - } + print("\033[2J\000"); printf(ansilogo); print("\033[37m\033[0m -Chargement noyaux\000"); ok(); + + printf ("\033[37m\033[0m -Nombre magique multiboot2 : %X\000", (u32) magic); + if (magic == MULTIBOOT2_BOOTLOADER_MAGIC) + ok(); + else + error(); + print("\033[37m\033[0m -Initilisation de la memoire (GDT)\000"); initgdt(&&next); next: