Forums before death by AOL, social media and spammers... "We can't have nice things"
|    alt.os.development    |    Operating system development chatter    |    4,255 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 3,877 of 4,255    |
|    wolfgang kern to Robert Pengelly    |
|    Re: COM1 interrupt for 16-bit OS (1/3)    |
|    11 Nov 23 08:50:01    |
      From: nowhere@never.at              On 11/11/2023 07:39, Robert Pengelly wrote:       > On Saturday, 11 November 2023 at 06:32:35 UTC, wolfgang kern wrote:       >> On 10/11/2023 17:50, Robert Pengelly wrote:       >>> Does anyone know how I get IRQ4 INT 0Ch working for a 16-bit OS? On       https://wiki.osdev.org/Interrupts it has "8-15 Default mapping of IRQ0-7 by       the BIOS at bootstrap", Is that only for 32-bit or is it for both 32 and 16       bit? Do I need to manipulate        things to get IRQ4 INT 0Ch working for 16-bit?       >> old 16 bit hardware had jumpers on COM/LPT add-on boards for setup IRQ-       >> number and CS aka I/O address.       >> modern stuff have this all emulated in the south-bridge (in the chip-set       >> on main board) and may or may not allow modification of their defaults.       >>       >> how much do you already know about IRQ-redirection ?       >>       >> it depends on your hardware if you need to modify anything.       >>       >> and what are you trying to achieve with IRQ4 ?       >> is there any COM-port connected to it at all ? my PC don't have any.       >> __       >> wolfgang       >       >> and what are you trying to achieve with IRQ4 ?       > I'm trying to figure out how to get data from a serial mouse as most of the       roms in pcem and 86box don't have a PS/2 option.       >       > I have:       >       > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;       ;;;;;;;;;;;;;;;;       > ;; Disable all interrupts.       > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;       ;;;;;;;;;;;;;;;;       > mov dx, HEX (03F9)       > xor al, al       > out dx, al       >       > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;       ;;;;;;;;;;;;;;;;       > ;; Enable DLAB (set baud rate divisor).       > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;       ;;;;;;;;;;;;;;;;       > mov dx, HEX (03FB)       > mov al, HEX (80)       > out dx, al       >       > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;       ;;;;;;;;;;;;;;;;       > ;; Set divisor.       > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;       ;;;;;;;;;;;;;;;;       > mov dx, HEX (03F8)       > mov al, HEX (03        ; 3 (lo byte) 38400 baud.       > out dx, al       >       > mov dx, HEX (03F9)       > xor al, a        ; (hi byte)       > out dx, al       >       > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;       ;;;;;;;;;;;;;;;;       > ;; 8 bits, no parity, one stop bit.       > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;       ;;;;;;;;;;;;;;;;       > mov dx, HEX (03FB)       > mov al, HEX (03)       > out dx, al       >       > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;       ;;;;;;;;;;;;;;;;       > ;; Enable FIF0, clear them, with 14-byte threshold.       > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;       ;;;;;;;;;;;;;;;;       > mov dx, HEX (03FA)       > mov al, HEX (C7)       > out dx, al       >       > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;       ;;;;;;;;;;;;;;;;       > ;; IRQs enabled, RTS/DSR set.       > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;       ;;;;;;;;;;;;;;;;       > mov dx, HEX (03FC)       > mov al, HEX (0B)       > out dx, al       >       > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;       ;;;;;;;;;;;;;;;;       > ;; Set in loopback mode, test the serial chip.       > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;       ;;;;;;;;;;;;;;;;       > mov dx, HEX (03FC)       > mov al, HEX (1E)       > out dx, al       >       > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;       ;;;;;;;;;;;;;;;;       > ;; Test serial chip (send byte 0xAE and check if serial       > ;; returns same byte).       > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;       ;;;;;;;;;;;;;;;;       > mov dx, HEX (03F8)       > mov al, HEX (AE)       > out dx, al       >       > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;       ;;;;;;;;;;;;;;;;       > ;; Check if serial is faulty (i.e. not same byte as sent).       > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;       ;;;;;;;;;;;;;;;;       > mov dx, HEX (03F8)       > xor ax, ax       > in al, dx       >       > cmp al, HEX (AE)       > jne .setup_interrupts       >       > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;       ;;;;;;;;;;;;;;;;       > ;; If serial is not faulty set it in normal operation mode       > ;; (not-loopback with IRQs enabled and OUT#1 and OUT#2 bits       enabled).       > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;       ;;;;;;;;;;;;;;;;       > mov dx, HEX (03FC)       > mov al, HEX (0F)       > out dx, al       >       > which I got from towards the bottom of https://wiki.osdev.org/Serial_Ports       and converted it to assembly. That code works I'm getting 0xAE but I can't       seem to read data from the mouse and I can't get an interrupt to work.              getting AE from previously written port may not mean much :)       are you sure the mouse is connected to COM_1 and set to IRQ_4 ?       how does your IRQ-routine work ?       __       wolfgang              here some info from my RBIL-copy on port 03F8:              PORT 03F8-03FF - Serial port (8250,8250A,8251,16450,16550,16550A,etc.) COM1       Range: PORT 02E8h-02EFh (COM2), PORT 02F8h-02FFh (typical non-PS/2       COM3), and        PORT 03E8h-03EFh (typical non-PS/2 COM4)       Note: chips overview:        8250 original PC, specified up to 56Kbd, but mostly runs        only 9600Bd, no scratchregister, bug: sometimes shots        ints without reasons        8250A, 16450, 16C451: ATs, most chips run up to 115KBd,        no bug: shots no causeless ints        8250B: PC,XT,AT, pseudo bug: shots one causeless int for        compatibility with 8250, runs up to 56KBd        16550, 16550N, 16550V: early PS/2, FIFO bugs        16550A,16550AF,16550AFN,16550C,16C551,16C552: PS/2, FIFO ok        82510: laptops & industry, multi emulation mode        (default=16450), special-FIFO.        8251: completely different synchronous SIO chip, not compatible!       SeeAlso: INT 14/AH=00h"SERIAL"              03F8 -W serial port, transmitter holding register (THR), which       contains the        character to be sent. Bit 0 is sent first.        bit 7-0 data bits when DLAB=0 (Divisor Latch Access Bit)       03F8 R- receiver buffer register (RBR), which contains the received        character. Bit 0 is received first        bit 7-0 data bits when DLAB=0 (Divisor Latch Access Bit)              [continued in next message]              --- SoupGate-Win32 v1.05        * Origin: you cannot sedate... all the things you hate (1:229/2)    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca