home bbs files messages ]

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,876 of 4,255   
   Robert Pengelly to wolfgang kern   
   Re: COM1 interrupt for 16-bit OS   
   10 Nov 23 22:39:49   
   
   From: robertapengelly@gmail.com   
      
   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.   
      
   --- 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