Skip to content

Commit c352acc

Browse files
committed
Fix errors
1 parent 4f7737a commit c352acc

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

day6/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ K_OBJS := asmhead.bin bootpack.bin io.bin pm.bin hankaku.bin desctbl.bin \
1414
SYS := haribote.sys
1515
IMG := haribote.img
1616

17-
QEMU_FLAGS :=
17+
QEMU_FLAGS := -device virtio-keyboard-pci -device virtio-mouse-pci -no-reboot
1818

1919
ifdef DEBUG
2020
QEMU_FLAGS += -gdb tcp::1234 -S

day6/bootpack.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
int main(void) {
88
struct BootInfo *binfo = (struct BootInfo *) ADR_BOOTINFO;
99
char mcursor[256];
10-
10+
1111
init_gdtidt();
1212
init_pic();
1313

1414
init_palette();
1515
init_screen(binfo->vram, binfo->scrnx, binfo->scrny);
16-
16+
1717
int mx = (binfo->scrnx - 16) / 2;
1818
int my = (binfo->scrny - 28 - 16) / 2;
1919
init_mouse_cursor8(mcursor, COL8_008484);

day6/desctbl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ void init_gdtidt(void) {
55
struct SegmentDescriptor *gdt = (struct SegmentDescriptor *) ADR_GDT;
66
struct GateDescriptor *idt = (struct GateDescriptor *) ADR_IDT;
77

8-
for (int i = 0; i < LIMIT_GDT / 8; i++) {
8+
for (int i = 0; i <= LIMIT_GDT / 8; i++) {
99
set_segmdesc(gdt + i, 0, 0, 0);
1010
}
1111

1212
set_segmdesc(gdt + 1, 0xffffffff, 0x00000000, AR_DATA32_RW);
1313
set_segmdesc(gdt + 2, LIMIT_BOOTPACK, ADR_BOOTPACK, AR_CODE32_ER);
1414
load_gdtr(LIMIT_GDT, ADR_GDT);
1515

16-
for (int i = 0; i < LIMIT_IDT / 8; i++) {
16+
for (int i = 0; i <= LIMIT_IDT / 8; i++) {
1717
set_gatedesc(idt + i, 0, 0, 0);
1818
}
1919
load_idtr(LIMIT_IDT, ADR_IDT);

day6/int.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ void int_handler21(int *esp) {
3535

3636
void int_handler2c(int *esp) {
3737
struct BootInfo *binfo = (struct BootInfo *) ADR_BOOTINFO;
38-
38+
3939
box_fill8(binfo->vram, binfo->scrnx, COL8_000000, 0, 0, 32 * 8 - 1, 15);
4040
put_fonts8_asc(binfo->vram, binfo->scrnx, 0, 0, COL8_FFFFFF, "INT 2C (IRQ-12) : PS/2 mouse");
4141

@@ -46,6 +46,6 @@ void int_handler2c(int *esp) {
4646

4747
void int_handler27(int *esp) {
4848
io_out8(PIC0_OCW2, 0x67);
49-
49+
5050
return;
5151
}

day6/inthandler.asm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ asm_int_handler21:
1313
MOV AX, SS
1414
MOV DS, AX
1515
MOV ES, AX
16-
call int_handler21
16+
CALL int_handler21
1717
POP EAX
1818
POPAD
1919
POP DS
@@ -29,7 +29,7 @@ asm_int_handler27:
2929
MOV AX, SS
3030
MOV DS, AX
3131
MOV ES, AX
32-
call int_handler21
32+
CALL int_handler27
3333
POP EAX
3434
POPAD
3535
POP DS
@@ -45,7 +45,7 @@ asm_int_handler2c:
4545
MOV AX, SS
4646
MOV DS, AX
4747
MOV ES, AX
48-
call int_handler21
48+
CALL int_handler2c
4949
POP EAX
5050
POPAD
5151
POP DS

0 commit comments

Comments
 (0)