From 734ab3852a4b3f315a459e97625540656d249b37 Mon Sep 17 00:00:00 2001 From: Nero <41307858+nero@users.noreply.github.com> Date: Sat, 15 Aug 2020 21:02:30 +0000 Subject: [PATCH] Remove skeleton of rom-based kernel --- kernel/intr.asm | 70 ------------------------------------------------- rom/kernel.asm | 68 ----------------------------------------------- 2 files changed, 138 deletions(-) delete mode 100644 kernel/intr.asm delete mode 100644 rom/kernel.asm diff --git a/kernel/intr.asm b/kernel/intr.asm deleted file mode 100644 index fcd0227..0000000 --- a/kernel/intr.asm +++ /dev/null @@ -1,70 +0,0 @@ - ; Get pointer to interrupt vector - ; IN al number - ; OUT 0:bx ptr to vector -intr_ptr: - xor bh, bh - mov bl, al - add bx, bx - add bx, bx - ret - - ; Set interrupt vector - ; IN al number - ; ds:dx ptr -intr_set: - push bx - call intr_ptr - ss mov [bx], dx - ss mov [bx+2], ds - pop bx - ret - - ; Get interrupt vector - ; IN al number - ; OUT es:bx ptr -intr_get: - call intr_ptr - ss mov es, [bx+2] - ss mov bx, [bx] - ret - - ; Save BIOS vectors - ; Trashes ax, cx, bx, ds -intr_backup: - mov cx, 0x20 - xor bx, bx - mov ds, bx -.loop: ; load segment - mov ax, [bx+2] - ; skip transfer if not pointing to BIOS - cmp ax, 0xA000 - jc .skip - ; store segment - mov [bx+ivt2+2], ax - ; copy offset - mov ax, [bx] - mov [bx+ivt2], ax - ; iterate to next vector -.skip: add bx, 4 - loop .loop - ret - - ; Restore BIOS vectors -intr_restore: - mov cx, 0x20 - xor bx, bx - mov ds, bx -.loop: ; load segment - mov ax, [bx+ivt2+2] - ; skip if not a vector to BIOS - cmp ax, 0xA000 - jc .skip - ; store segment - mov [bx+2], ax - ; copy offset - mov ax, [bx+ivt2] - mov [bx], ax - ; iterate to next vector -.skip: add bx, 4 - loop .loop - ret diff --git a/rom/kernel.asm b/rom/kernel.asm deleted file mode 100644 index 2dcf719..0000000 --- a/rom/kernel.asm +++ /dev/null @@ -1,68 +0,0 @@ - cpu 8086 - org 0x0000 - - db 0x55, 0xAA - db 0x00 - jmp near init - - times (0x18 - ($-$$)) db 0 - dw 0 - dw pnp - -pnp: db "$PnP" - db 1 ; version 1 - db 2 ; 2 * 16 length - dw 0 ; offset of next header - db 0 - db 0 ; checksum (filled by fix-rom) - dd 0 ; device identifier - dw 0 ; manufacturer string - dw name ; product name string - db 0,0,0 ; device type string - db 0x20 ; device indicator, bit for "read cacheable" set - dw 0 ; boot connection vector - dw 0 ; boot disconnect vector - dw boot ; bootstrap entry point - dw 0 ; reserved - - ; zero for setting sreg without using reg -zero: dw 0 - -name: db "rdos", 0 - -init: push ds - - ; DS := 0 - mov ds, [cs:zero] - ; set entry points vectors - mov word [0x19*4], boot - mov word [0x19*4+2], cs - - pop ds - retf - - ; entry point on boot, preempting disks - ; this also doubles as entry point for reboot -boot: xor ax, ax - mov ss, ax - mov sp, stack - - int 3 - -hlt: hlt - jmp hlt - - %include "kernel/intr.asm" - - align 512 - -absolute 0x400 - resb (0x501 - ($-$$)) - - ; copy of the first 32 interrupt vectors -ivt2: resd 0x20 - - ; 8kb stack - alignb 2 - resw 0x2000 -stack: