Code: Select all
__outbyte( 0x03F8 + 3, 0x80 ); // Enable DLAB to change the BAUD rate
__outbyte( 0x03F8 + 0, 1 ); // Set the BAUD rate to 115200
__outbyte( 0x03F8 + 1, 0 ); // Set the BAUD rate to 115200
__outbyte( 0x03F8 + 3, 3 ); // Disable DLAB, specify 8-bit data unit sizes, one stop bit, and no parity
__outbyte( 0x03F8 + 1, 0 ); // Disable interrupts
__outbyte( 0x03F8 + 2, 7 ); // Enable FIFO, clear out the receive and transmit buffers
Code: Select all
void
output_byte(
_input u16 port_address,
_input u8 value
);
void
output_byte_string(
_input u16 port_address,
_input char* str,
_input u32 len
);
Code: Select all
output_byte PROC
mov al, dl
mov dx, cx
out dx, al
ret
output_byte ENDP
output_byte_string PROC
push rsi
mov rsi, rdx
mov dx, cx
mov ecx, r8d
rep outsb dx, byte ptr [rsi]
pop rsi
ret
output_byte_string ENDP
Code: Select all
__outbyte( 0x03F8 + 1, 0x00 ); // Disable all interrupts
__outbyte( 0x03F8 + 3, 0x80 ); // Enable DLAB (set baud rate divisor)
__outbyte( 0x03F8 + 0, 0x03 ); // Set divisor to 3 (lo byte) 38400 baud
__outbyte( 0x03F8 + 1, 0x00 ); // (hi byte)
__outbyte( 0x03F8 + 3, 0x03 ); // 8 bits, no parity, one stop bit
__outbyte( 0x03F8 + 2, 0xC7 ); // Enable FIFO, clear them, with 14-byte threshold
__outbyte( 0x03F8 + 4, 0x0B ); // IRQs enabled, RTS/DSR set
__outbyte( 0x03F8 + 4, 0x1E ); // Set in loopback mode, test the serial chip
__outbyte( 0x03F8 + 0, 0xAE ); // Test serial chip (send byte 0xAE and check if serial returns same byte)
byte = __inbyte( 0x03F8 ); // Confirmed: return result is 0xAE
__outbyte( 0x03F8 + 4, 0x0F );
- Serial mode
- Serial line: COM1
- Speed (baud): 115200
- Data bits: 8
- Stop bits: 1
- Parity: None
- Flow control: XON/XOFF (Default)
The physical processor backing the VM is an Intel i9-13900K, running on VMware Workstation 17 Pro (17.5.0 build-22583795).
Thank you for your time. I really appreciate it, and all the best.