mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-31 22:48:21 +00:00
Makefile: add USE_E9 to the preprocessor flags and make the relevant files understand it
This commit is contained in:
@@ -23,9 +23,10 @@ KERNELDEPS=$(call rwildcard,bin,*.o)
|
|||||||
KERNELSRCDEPS=$(call rwildcard,src,*.c)
|
KERNELSRCDEPS=$(call rwildcard,src,*.c)
|
||||||
INCLUDEDIR=$(SRCDIR)/include
|
INCLUDEDIR=$(SRCDIR)/include
|
||||||
ARCHINCLUDE=$(SRCDIR)/arch/$(TARGET)/include
|
ARCHINCLUDE=$(SRCDIR)/arch/$(TARGET)/include
|
||||||
|
KERNELCONFIG=
|
||||||
KERNEL=$(ISO)/kernel
|
KERNEL=$(ISO)/kernel
|
||||||
INITRD=$(ISO)/initrd
|
INITRD=$(ISO)/initrd
|
||||||
CFLAGS=-c -ffreestanding -mcmodel=kernel -O2 -mno-red-zone -mno-mmx -mno-sse -mno-sse2 -nostdlib -I$(INCLUDEDIR) -I$(ARCHINCLUDE) --debug
|
CFLAGS=-c -ffreestanding -mcmodel=kernel -O2 -mno-red-zone -mno-mmx -mno-sse -mno-sse2 -nostdlib -I$(INCLUDEDIR) -I$(ARCHINCLUDE) --debug $(KERNELCONFIG)
|
||||||
LDFLAGS=-ffreestanding -nostdlib -lgcc -Wl,-T,kernel.ld -debug
|
LDFLAGS=-ffreestanding -nostdlib -lgcc -Wl,-T,kernel.ld -debug
|
||||||
ISO=$(PWD)/boot/$(TARGET)/iso
|
ISO=$(PWD)/boot/$(TARGET)/iso
|
||||||
SRCDIR=$(PWD)/src/
|
SRCDIR=$(PWD)/src/
|
||||||
@@ -60,10 +61,10 @@ sysdisk.iso: $(ISO)
|
|||||||
xorriso -as mkisofs -b limine-cd.bin -no-emul-boot -boot-load-size 4 -boot-info-table --efi-boot limine-cd-efi.bin -efi-boot-part --efi-boot-image --protective-msdos-label $(ISO) -o sysdisk.iso
|
xorriso -as mkisofs -b limine-cd.bin -no-emul-boot -boot-load-size 4 -boot-info-table --efi-boot limine-cd-efi.bin -efi-boot-part --efi-boot-image --protective-msdos-label $(ISO) -o sysdisk.iso
|
||||||
|
|
||||||
run:
|
run:
|
||||||
qemu-system-x86_64 -cdrom sysdisk.iso -m 8G -smp cpus=6
|
qemu-system-x86_64 -cdrom sysdisk.iso -m 8G -smp cpus=6 -debugcon stdio
|
||||||
|
|
||||||
run-kvm:
|
run-kvm:
|
||||||
qemu-system-x86_64 -cdrom sysdisk.iso -m 8G -smp cpus=6 -enable-kvm
|
qemu-system-x86_64 -cdrom sysdisk.iso -m 8G -smp cpus=6 -enable-kvm -debugcon stdio
|
||||||
|
|
||||||
test:
|
test:
|
||||||
qemu-system-x86_64 -monitor stdio -cdrom sysdisk.iso -d int -no-reboot -no-shutdown -m 8G -smp cpus=6
|
qemu-system-x86_64 -monitor stdio -cdrom sysdisk.iso -d int -no-reboot -no-shutdown -m 8G -smp cpus=6
|
||||||
|
|||||||
@@ -1,12 +1,16 @@
|
|||||||
#include <arch/io.h>
|
#include <arch/io.h>
|
||||||
|
|
||||||
void e9_putc(char c){
|
void e9_putc(char c){
|
||||||
|
#ifdef USE_E9
|
||||||
outb(0xE9, c);
|
outb(0xE9, c);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void e9_puts(char* s){
|
void e9_puts(char* s){
|
||||||
|
#ifdef USE_E9
|
||||||
size_t len = strlen(s);
|
size_t len = strlen(s);
|
||||||
|
|
||||||
for(uintmax_t i = 0; i < len; ++i)
|
for(uintmax_t i = 0; i < len; ++i)
|
||||||
outb(0xE9, s[i]);
|
outb(0xE9, s[i]);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
#include <arch/e9.h>
|
#include <arch/e9.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
|
#ifdef USE_E9
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
@@ -26,3 +28,5 @@ static devcalls calls = {
|
|||||||
void e9out_init(){
|
void e9out_init(){
|
||||||
devman_newdevice("e9out", TYPE_CHARDEV, MAJOR_E9OUT, 0, &calls);
|
devman_newdevice("e9out", TYPE_CHARDEV, MAJOR_E9OUT, 0, &calls);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|||||||
@@ -66,8 +66,12 @@ void kmain(){
|
|||||||
consoledev_init();
|
consoledev_init();
|
||||||
|
|
||||||
pseudodevs_init();
|
pseudodevs_init();
|
||||||
|
|
||||||
|
#ifdef USE_E9
|
||||||
|
|
||||||
e9out_init();
|
e9out_init();
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
fb_init();
|
fb_init();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user