501
Lowlevel-Coding / Re: Multibootstruktur funktioniert nicht
« am: 12. December 2008, 20:38 »
Bin mir grad nicht sicher.
Das muss doch heißen:
MULTIBOOT_FLAGS equ 0x02
oder?
Das muss doch heißen:
MULTIBOOT_FLAGS equ 0x02
oder?
27. April 2024, 17:16
Diese Sektion erlaubt es dir alle Beiträge dieses Mitglieds zu sehen. Beachte, dass du nur solche Beiträge sehen kannst, zu denen du auch Zugriffsrechte hast.
asm ("mov $0x80000002,%eax;"
"cpuid;"
"mov %eax":"m"(cpuidstring));
Makefile:19: *** missing separator. Schluss.
# the compiler-paths and the flags for the compiler
CC = /usr/bin/gcc
CFLAGS = -Wall -O3 -fstrength-reduce -fomit-frame-pointer -finline-functions -nostdinc -fno-builtin -march=i386 -I./kernel/include -c
ASM = /usr/bin/nasm
ASMFLAGS = -felf
# the path to the linker and his flags
LD = /usr/bin/ld
LDFLAGS = -T linker.ld
#the paths to the source files
CSRC = boot_kernel.c boot_system.c kernel/gdt.c kernel/kernel32.c kernel/display/display.c kernel/interrupt/exception.c kernel/interrupt/idt.c kernel/interrupt/irq.c kernel/interrupt/pic.c kernel/interrupt/pit.c kernel/memory/physmem.c
ASMSRC = boot_system.asm kernel/interrupt/exception.asm kernel/interrupt/irq.asm
#the paths to the object files
COBJ = obj/boot_kernel.c.o obj/boot_system.c.o obj/gdt.c.o obj/kernel32.c.o obj/display.c.o obj/exception.c.o obj/idt.c.o obj/irq.c.o obj/pic.c.o obj/pit.c.o obj/physmem.c.o
ASMOBJ = obj/boot_system.asm.o obj/exception.asm.o obj/irq.asm.o
compileASM: $(ASMOBJ) $(COBJ)
$(ASM) $(ASMFLAGS) -o $(ASMOBJ) $(ASMSRC)
$(CC) $(CFLAGS) -o $(COBJ) $(CSRC)
$(LD) $(LDFLAGS) -o bin/kernel.bin $(COBJ) $(ASMOBJ)
Mein Problem ist nur, dass ich nicht weiß, wo mein Kernel liegt.Den Anfang kennst du, weil du den ja sowieso dem Linker vorgibst. Aber wie willst du rauskriegen, wo der Kernel zu Ende ist?
Ich habe gesehen, dass ihr das im linker macht.
Ich habe leider nur keine Ahnung von linker-files.
Nun habe ich mir überlegt, dass ich das doch auch von Hand berechnen kann.
Das müsste doch ohne weiteres gehen, oder?
void phys_mark_range_free(physaddr_t block , size_t size){
size_t i;
for(i = 0; i < size; i++){
size_t bitmap_index = (size_t) block / BLOCK_SIZE / BITS_PER_BLOCK;
physmemm_bitmap[bitmap_index] |=
1 << (((size_t) block / BLOCK_SIZE) & (BITS_PER_BLOCK - 1));
}
}
physmemm_bitmap[bitmap_index] |= 1 << (((size_t) block / BLOCK_SIZE) & (BITS_PER_BLOCK - 1));
ZitatAchso, wo bekomme ich den Multiboot her?Ein Pointer auf die Struktur liegt in ebx (oder war es eax?), wenn er in deinen Kernel springt. Am besten pushst du den auf den Stack, damit du ihn in deiner C-Hauptfunktion als Parameter nehmen kannst.
Ich weiß, den erstellt GRUB aber wo liegt der?