Serial output console (disable by default)

When enabled with current settings,
it will work on com1 using a 115200 baud connection
8 bits words, no parity bit, 1 stop bit

git-svn-id: svn://kolibrios.org@1043 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
hidnplayr 2009-03-02 21:05:40 +00:00
parent 3141a1036d
commit f6697caafb

View File

@ -17,6 +17,7 @@
;; Sergey Semyonov (Serge)
;; Johnny_B
;; SPraid (simba)
;; Hidnplayr
;;
;; Data in this file was originally part of MenuetOS project which is
;; distributed under the terms of GNU GPL. It is modified and redistributed as
@ -60,6 +61,9 @@ $Revision$
USE_COM_IRQ equ 1 ; make irq 3 and irq 4 available for PCI devices
; Enabling the next line will enable serial output console
;debug_com_base equ 0x3f8 ; 0x3f8 is com1, 0x2f8 is com2, 0x3e8 is com3, 0x2e8 is com4, no irq's are used
include "proc32.inc"
include "kglobals.inc"
include "lang.inc"
@ -870,6 +874,48 @@ first_app_found:
call set_lights
;// mike.dld ]
; Setup serial output console (if enabled)
if defined debug_com_base
; enable Divisor latch
mov dx, debug_com_base+3
mov al, 1 shl 7
out dx, al
; Set speed to 115200 baud (max speed)
mov dx, debug_com_base
mov al, 0x01
out dx, al
mov dx, debug_com_base+1
mov al, 0x00
out dx, al
; No parity, 8bits words, one stop bit, dlab bit back to 0
mov dx, debug_com_base+3
mov al, 3
out dx, al
; disable interrupts
mov dx, debug_com_base+1
mov al, 0
out dx, al
; clear + enable fifo (64 bits)
mov dx, debug_com_base+2
mov al, 0x7 + 1 shl 5
out dx, al
end if
; START MULTITASKING
if preboot_blogesc
@ -4763,6 +4809,23 @@ sys_msg_board:
cmp eax, 1
jne .smbl1
if defined debug_com_base
push dx ax
@@: ; Wait for empty transmit register (yes, this slows down system..)
mov dx, debug_com_base+5
in al, dx
test al, 1 shl 5
jz @r
mov dx, debug_com_base ; Output the byte
mov al, bl
out dx, al
pop ax dx
end if
mov [msg_board_data+ecx],bl
inc ecx