Remove rom and pxe boot related stuff

I dont intend to ever implement that
This commit is contained in:
Nero 2021-01-23 17:44:15 +00:00
parent ebd356ed8e
commit ff179a5e98
5 changed files with 2 additions and 384 deletions

View File

@ -16,14 +16,14 @@ QEMU_ARGS += $(shell test -w /dev/kvm && echo --enable-kvm)
ifdef DEBUG
ROMS += dprintf.rom
NASM_ARGS += -l $(basename $@).lst
NASM_ARGS += -l $(basename $@).lst -DDEBUG=1
endif
ifndef DISPLAY
QEMU_ARGS += --display curses
endif
.PHONY: default bootstrap clean qemu-rom qemu-floppy qemu-pxe
.PHONY: default clean qemu-floppy5 qemu-floppy3
default: fd1440.img
@ -76,12 +76,3 @@ qemu-floppy5: fd360.img $(ROMS)
qemu-hdd: hdimage.img $(ROMS)
$(QEMU) $(QEMU_ARGS) -boot c -hda hdimage.img
qemu-pxe: pxeboot.0 $(ROMS)
$(QEMU) $(QEMU_ARGS) -boot n \
-option-rom /usr/share/qemu/pxe-rtl8139.rom \
-device e1000,netdev=mynet0,mac=52:54:00:12:34:56 \
-netdev user,id=mynet0,net=192.168.76.0/24,dhcpstart=192.168.76.9,tftp=$(CURDIR),bootfile=pxeboot.0
qemu-rom: kernel.rom
$(QEMU) $(QEMU_ARGS) --option-rom kernel.rom

View File

@ -1,71 +0,0 @@
org 0x7C00
xor ax, ax
mov ds, ax
mov es, ax
mov ss, ax
mov sp, 0x7C00
mov si, 0x400
loop: mov dx, si
call dmpdx
mov al, 0x20
int 0x10
int 0x10
push si
mov cx, 8
wloop: lodsw
xchg al, ah
mov dx, ax
push cx
call dmpdx
mov al, 0x20
int 0x10
pop cx
loop wloop
pop si
mov al, 0x20
int 0x10
mov cx, 16
aloop: lodsb
cmp al, 0x20
jnc noadj
mov al, '.'
noadj: int 0x10
loop aloop
mov al, 0x0A
int 0x10
mov al, 0x0D
int 0x10
cmp si, 0x500
jc loop
hlt: hlt
jmp hlt
dmpdx: ; setup bx and ah for int 10h call
xor bx, bx
mov ah, 0x0e
mov cl, 4
; this double-call is essentially a 4 times repeating loop
call dmpdx1
dmpdx1: call dmpdx2
dmpdx2: ; grab highest nibble from dx
mov al, dh
; remove highest nibble from dx
shl dx, cl
; shift away second-highest nibble that we accidentally copied
shr al, cl
; map 0-9 to ascii codes for '0' to '9'
add al, 0x30
; if result is larger than '9', ...
cmp al, 0x3a
jl dmpdx3
; ... add 7 so we continue at 'A'
add al, 7
dmpdx3: int 0x10
ret

View File

@ -1,113 +0,0 @@
org 0x7C00
main:
mov ax, [es:bx+0x0A]
mov [cs:pxejmp], ax
mov ax, [es:bx+0x0A+2]
mov [cs:pxejmp+2], ax
mov ax, cs
mov ds, ax
mov si, pxejmp
call dump
mov ax, cs
mov ds, ax
mov di, pxestat
mov bx, 0x0071
call UsePXEAPI
mov ax, cs
mov ds, ax
mov si, pxestat
call dump
call dump
hlt: hlt
jmp hlt
UsePXEAPI:
push ds
push di
push bx
int 3
call far [pxejmp]
int 3
add sp, 6
ret
pxejmp: dd 0
pxestat:
.Status dw 0
.PacketType dw 2
.BufferSize dw 0
.BufferOff dw 0
.BufferSeg dw 0
.BufferLimit dw 0
;tftp_open:
; .Status dw 0
; .SIP dd 0
; .GIP dd 0
; .Filename db "pxe.bs"
; times (128-6) db 0
; .Port dw 0
; .PacketSize dw 0
space:
mov al, 0x20
jmp putc
putbc:
cmp al, 0x80
jnc dot
cmp al, 0x20
jnc putc
dot:
mov al, '.'
putc:
push ax
push bx
mov ah, 0x0e
xor bx, bx
int 0x10
pop bx
pop ax
ret
dump: push cx
mov ax, ds
call print16
mov al, ':'
call putc
mov ax, si
call print16
call space
call space
mov cx, 0x08
push si
.hloop: lodsb
call print8
lodsb
call print8
call space
loop .hloop
pop si
call space
mov cx, 0x10
.aloop: lodsb
call putbc
loop .aloop
mov al, 0x0A
call putc
mov al, 0x0D
call putc
pop cx
ret
%include "print.asm"
%include "printf.asm"

View File

@ -1,90 +0,0 @@
org 0x7c00
xor ax, ax
mov ds, ax
mov es, ax
mov ss, ax
mov sp, 0x7c00
jmp 0:start
getc:
mov ah, 0x02
mov dx, 0x0000
int 0x14
test ah, 0x80
jnz getc
ret
putc:
mov ah, 0x01
mov dx, 0x0000
int 0x14
ret
init_port:
mov ah, 0x00
mov al, 0b11100011
mov dx, 0x0000
int 0x14
ret
dump:
mov si, 0x500
mov cx, di
sub cx, si
.loop:
lodsb
call print8
loop .loop
mov al, 0x0A
call putc
mov al, 0x0D
call putc
ret
line_reset:
cmp di, 0x500
je .reset
call line_process
.reset:
mov di, 0x500
xor bp, bp
jmp mainloop
line_process:
call dump
ret
start:
call init_port
mov di, 0x500
jmp line_reset
mainloop:
call getc
cmp al, ':'
je line_reset
cmp al, 0x20
jb line_reset
sub al, 0x30
cmp al, 9
jbe .noadjust
sub al, 7
.noadjust:
test bp, bp
jnz .secondnib
mov cl, 4
shl al, cl
mov [di], al
not bp
jmp mainloop
.secondnib:
or [di], al
inc di
not bp
jmp mainloop
%include "print.asm"
times 510-($-$$) db 0x00
db 0x55,0xaa

View File

@ -1,99 +0,0 @@
org 0x7C00
cols: equ 80
rows: equ 30
main:
mov ax, cs
mov ds, ax
mov es, ax
mov ss, ax
xor sp, sp
mov ah, 0x42
mov si, dap
int 0x13
mov ax, 0x0011
int 0x10
mov di, txtbuf
.loop:
call sync
xor ax, ax
int 0x16
stosb
jmp .loop
hlt:
hlt
jmp hlt
sync:
push ax
push si
push di
push es
mov si, txtbuf
mov ax, 0xA000
mov es, ax
mov di, 0
mov bx, font
mov cx, rows
.loop:
call charline
loop .loop
pop es
pop di
pop si
pop ax
ret
charline:
push bx
push cx
mov cx, 8
.loop:
call scanline
call scanline
inc bh
loop .loop
add si, cols
pop cx
pop bx
ret
scanline:
push si
push cx
mov cx, cols
.loop:
lodsb
mov bl, al
mov al, [bx]
stosb
loop .loop
pop cx
pop si
ret
dap:
db 0x10
db 1
dw 20
dw font, 0
dq 1
times (510 - ($-$$)) nop
dw 0xAA55
font:
incbin "cp437.bin"
txtbuf:
times (rows * cols) db 0
end: