Merging updated interrupt debug code

This commit is contained in:
shockrah 2019-11-06 11:27:51 -08:00
commit afb5ea45d7
5 changed files with 8 additions and 12 deletions

View File

@ -1,5 +1,5 @@
megs: 32 megs: 32
display_library: x display_library: x, options="gui_debug"
romimage: file=/usr/share/bochs/BIOS-bochs-latest romimage: file=/usr/share/bochs/BIOS-bochs-latest
vgaromimage: file=/usr/share/bochs/VGABIOS-lgpl-latest vgaromimage: file=/usr/share/bochs/VGABIOS-lgpl-latest
ata0-master: type=cdrom, path=os.iso, status=inserted ata0-master: type=cdrom, path=os.iso, status=inserted
@ -8,4 +8,4 @@ log: bochslog.txt
clock: sync=realtime, time0=local clock: sync=realtime, time0=local
cpu: count=1, ips=1000000 cpu: count=1, ips=1000000
com1: enabled=1, mode=file, dev=COM1.out com1: enabled=1, mode=file, dev=COM1.out
display_library: x, options="gui_debug" magic_break: enabled=1

View File

@ -94,7 +94,8 @@ void interrupt_handler(struct cpu_reg_state* cpu) {
if(cpu->int_no < 32) { if(cpu->int_no < 32) {
printf(err_msg[cpu->int_no]); printf(err_msg[cpu->int_no]);
} }
serial_pic_ack(cpu->int_no); for(;;);
//serial_pic_ack(cpu->int_no);
return; return;
} }

View File

@ -6,7 +6,7 @@
#include "gdt.h" #include "gdt.h"
void kinit() { void kinit() {
gdt_configure(); //gdt_configure();
init_idt(); init_idt();
test_dispatcher(); test_dispatcher();
} }
@ -14,5 +14,8 @@ void kinit() {
void kmain() { void kmain() {
kinit(); kinit();
__asm__("xchg bx, bx");
__asm__("xor eax, eax");
__asm__("div al");
for(;;); // the most amazing loop for(;;); // the most amazing loop
} }

View File

@ -3,12 +3,6 @@
#include "tests.h" #include "tests.h"
#include "serial.h" #include "serial.h"
void divide_by_zero() {
// here we can test the divide by zero without gcc noticing
__asm__("mov eax, 0");
__asm__("div al");
}
void test_serial_write() { void test_serial_write() {
char* serial1 = "0123456789abcdef0123456789abcdef"; char* serial1 = "0123456789abcdef0123456789abcdef";
serial_write(serial1, strlen(serial1)); serial_write(serial1, strlen(serial1));
@ -23,6 +17,5 @@ void test_write() {
void test_dispatcher() { void test_dispatcher() {
clear_fb(); clear_fb();
test_write(); test_write();
divide_by_zero();
test_write(); test_write();
} }

View File

@ -1,6 +1,5 @@
#include "types.h" #include "types.h"
#include "stlio.h" #include "stlio.h"
void divide_by_zero();
void test_write(); void test_write();
void test_dispatcher(); void test_dispatcher();