backported fixes from 256boss:
[bootcensus] / src / boot / boot.s
index 50817a3..4f0023a 100644 (file)
@@ -1,5 +1,5 @@
 # pcboot - bootable PC demo/game kernel
-# Copyright (C) 2018  John Tsiombikas <nuclear@member.fsf.org>
+# Copyright (C) 2018-2019  John Tsiombikas <nuclear@member.fsf.org>
 # 
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -37,8 +37,6 @@ boot:
 
        mov %dl, drive_number
 
-       call setup_serial
-
        call get_drive_chs
 
        mov $loading_msg, %si
@@ -244,7 +242,6 @@ end:        popa
 print_char:
        push %es
 
-       push %ax
        cmp $10, %ax
        jnz 0f
        mov $32, %ax
@@ -258,8 +255,6 @@ print_char:
        movb $7, %es:1(%di)
        incw cursor_x
 
-       pop %ax
-       call ser_putchar
        pop %es
        ret
 
@@ -287,69 +282,6 @@ convloop:
        popa
        ret
 
-       .set UART_DATA, 0x3f8
-       .set UART_DIVLO, 0x3f8
-       .set UART_DIVHI, 0x3f9
-       .set UART_FIFO, 0x3fa
-       .set UART_LCTL, 0x3fb
-       .set UART_MCTL, 0x3fc
-       .set UART_LSTAT, 0x3fd
-       .set DIV_9600, 115200 / 9600
-       .set LCTL_8N1, 0x03
-       .set LCTL_DLAB, 0x80
-       .set FIFO_ENABLE_CLEAR, 0x07
-       .set MCTL_DTR_RTS_OUT2, 0x0b
-       .set LST_TREG_EMPTY, 0x20
-
-setup_serial:
-       # set clock divisor
-       mov $LCTL_DLAB, %al
-       mov $UART_LCTL, %dx
-       out %al, %dx
-       mov $DIV_9600, %ax
-       mov $UART_DIVLO, %dx
-       out %al, %dx
-       shr $8, %ax
-       mov $UART_DIVHI, %dx
-       out %al, %dx
-       # set format 8n1
-       mov $LCTL_8N1, %al
-       mov $UART_LCTL, %dx
-       out %al, %dx
-       # clear and enable fifo
-       mov $FIFO_ENABLE_CLEAR, %al
-       mov $UART_FIFO, %dx
-       out %al, %dx
-       # assert RTS and DTR
-       mov $MCTL_DTR_RTS_OUT2, %al
-       mov $UART_MCTL, %dx
-       out %al, %dx
-       ret
-
-       # expects a character in al
-ser_putchar:
-       push %dx
-
-       cmp $10, %al
-       jnz 0f
-       push %ax
-       mov $13, %al
-       call ser_putchar
-       pop %ax
-
-0:     mov %al, %ah
-       # wait until the transmit register is empty
-       mov $UART_LSTAT, %dx
-wait:  in %dx, %al
-       and $LST_TREG_EMPTY, %al
-       jz wait
-       mov $UART_DATA, %dx
-       mov %ah, %al
-       out %al, %dx
-
-       pop %dx
-       ret
-       
        .org 510
        .byte 0x55
        .byte 0xaa