From 14b109ea24dc5cb1db948de57a2a44c80ef4622e Mon Sep 17 00:00:00 2001 From: Brett Weiland Date: Wed, 24 Mar 2021 15:36:54 -0500 Subject: modified: README.md modified: compiler/create_crosscompiler.sh deleted: notes modified: src/.gdb_history deleted: src/amd64_vol2.pdf modified: src/bootloader/bios_functions/bios_disk.asm modified: src/bootloader/bios_functions/print.asm modified: src/bootloader/bootloader.asm modified: src/bootloader/cpu_check.asm modified: src/bootloader/enter_kernel.asm deleted: src/bootloader/enter_kernel_backup modified: src/bootloader/gdt.asm deleted: src/bootloader/multicore.asm deleted: src/bootloader/notes new file: src/debug/gdbinit.gdb deleted: src/indigo_os modified: src/kernel/include/libc.h modified: src/kernel/include/paging.h modified: src/kernel/include/video.h modified: src/kernel/kernel.c modified: src/kernel/libs/acpi.c modified: src/kernel/libs/drivers/serial.c modified: src/kernel/libs/drivers/video.c modified: src/kernel/libs/libc.c modified: src/kernel/libs/page.c modified: src/link.ld modified: src/makefile new file: tools/README.md modified: tools/page/page.py --- src/kernel/libs/drivers/serial.c | 20 ++++++++------------ src/kernel/libs/drivers/video.c | 3 +++ 2 files changed, 11 insertions(+), 12 deletions(-) (limited to 'src/kernel/libs/drivers') diff --git a/src/kernel/libs/drivers/serial.c b/src/kernel/libs/drivers/serial.c index 665f06c..25f89ad 100644 --- a/src/kernel/libs/drivers/serial.c +++ b/src/kernel/libs/drivers/serial.c @@ -1,10 +1,6 @@ #include #include -//you can add more options if you need to later -// PORT + 3: values are from bit zero (right) to left -// dlab(1) | misteryyy bone(1) | paraty(3) | stop bits (1) | character length (2) static inline void outb(uint16_t port, uint8_t value) { - //here "a" is the a register, and "Nd" is inteter (I think?) in the d register asm volatile( "outb %0, %1" :: "a"(value), "Nd"(port) ); @@ -19,14 +15,14 @@ static inline uint8_t inb(uint16_t port) { } int init_serial(uint16_t port) { - outb(port + 1, 0x00); // disable them fuckin interupts - outb(port + 3, 0x80); // sets dlab, allowing custom serial speeds - outb(port + 0, 0x06); // speed is 115200/6 + outb(port + 1, 0x00); + outb(port + 3, 0x80); + outb(port + 0, 0x06); outb(port + 1, 0x00); - outb(port + 3, 0x03); // disables dlab, as well as 8 bit char len, 1 stop bit, no paraty, no mystery - outb(port + 2, 0xc7); // I have no fucking clue what this means - outb(port + 4, 0x0b); // don't know what this means eather... delete if you can - outb(port + 4, 0x1e); // loopback mode (where the hell is this documented????) + outb(port + 3, 0x03); + outb(port + 2, 0xc7); + outb(port + 4, 0x0b); + outb(port + 4, 0x1e); outb(port + 0, 0xae); // test char @@ -38,6 +34,6 @@ int init_serial(uint16_t port) { } void _putchar_serial(uint16_t port, char msg) { - while(!(inb(port + 5) & 0x20)); //wait for transmit to be doneroni + while(!(inb(port + 5) & 0x20)); //wait for transmit to be done outb(port, msg); } diff --git a/src/kernel/libs/drivers/video.c b/src/kernel/libs/drivers/video.c index 9bb4187..ab73bb0 100644 --- a/src/kernel/libs/drivers/video.c +++ b/src/kernel/libs/drivers/video.c @@ -1,5 +1,8 @@ #include #include + +//to be implimented when paging is set up + void dump_video() { struct mode_info *video = (struct mode_info *)0x600; printf("Video info:\nx:\t%u\ny:\t%u\nbbp:\t%u\nloc:\t0x%p\n", video->width, video->height, video->bpp, video->framebuffer); -- cgit v1.2.3