hardware-port

outb() does not work in LDD3 example short module

 ̄綄美尐妖づ 提交于 2020-01-07 03:28:08
问题 I am trying short.c in examples of Linux Device Driver 3 My PC has Parallel Port and after the Ubuntu boots up, I can see these: cat /proc/ioports 0378-037a : parport0 037b-037f : parport0 outp 0x378 1 (outp is another example in LDD3 which write data to ports) the LED on the port is ON. Then I run these commands to remove modules rmmod lp rmmod parport_pc cat /proc/ioports (There is no module on 0378-037f any more.) I run this again but the LED is not ON this time. outp 0x378 1 Then I

PC hardware port access from Java on Linux

喜夏-厌秋 提交于 2019-12-11 07:55:27
问题 What is the Java-on-Linux equivalent to the C byte-sized PC-architecture hardware port input/output functions? For output there is outb as in this: tmp = inb(0x61); if (tmp != (tmp | 0x01)) outb(0x61, tmp | 0x01); For input there is inb as in this: tmp = (inb(0x61) & 0xfe); outb(0x61, tmp); Purpose: I want to implement something that imposes less overhead than this: try { Runtime.getRuntime().exec("beep") } catch (IOException e) {} as an alternative to sending code 7 (the bell char) to the

Low level I/O access using outb and inb

允我心安 提交于 2019-12-07 05:56:57
问题 i'm having hard time trying to understand how interrupts work. the code below initialize the Programmable Interrupt Controller #define PIC0_CTRL 0x20 /* Master PIC control register address. */ #define PIC0_DATA 0x21 /* Master PIC data register address. */ /* Mask all interrupts*/ outb (PIC0_DATA, 0xff); /* Initialize master. */ outb (PIC0_CTRL, 0x11); /* ICW1: single mode, edge triggered, expect ICW4. */ outb (PIC0_DATA, 0x20); /* ICW2: line IR0...7 -> irq 0x20...0x27. */ outb (PIC0_DATA,

Low level I/O access using outb and inb

坚强是说给别人听的谎言 提交于 2019-12-05 09:55:35
i'm having hard time trying to understand how interrupts work. the code below initialize the Programmable Interrupt Controller #define PIC0_CTRL 0x20 /* Master PIC control register address. */ #define PIC0_DATA 0x21 /* Master PIC data register address. */ /* Mask all interrupts*/ outb (PIC0_DATA, 0xff); /* Initialize master. */ outb (PIC0_CTRL, 0x11); /* ICW1: single mode, edge triggered, expect ICW4. */ outb (PIC0_DATA, 0x20); /* ICW2: line IR0...7 -> irq 0x20...0x27. */ outb (PIC0_DATA, 0x04); /* ICW3: slave PIC on line IR2. */ outb (PIC0_DATA, 0x01); /* ICW4: 8086 mode, normal EOI, non

Windows equivalent of inb(), outb(), low level i/o

我的梦境 提交于 2019-12-01 11:50:34
I have some Linux code that monitors our hardware by collecting temperatures, voltages, and fan speeds, from the motherboard using inb(), outb(), inl(), etc. low level i/o functions. My challenge is to port that code over to run under Windows as a simple console app. But am puzzled in what functions Win32 (or .NET) provide that allow me permission to access direct memory mapped ports. I don't want to code a system driver either. My Windows tool preference is VS2008. (fyi) Is this possible? The default protection level for I/O ports in Windows prevents a user-mode program from using inp and out

Windows equivalent of inb(), outb(), low level i/o

喜夏-厌秋 提交于 2019-12-01 10:43:19
问题 I have some Linux code that monitors our hardware by collecting temperatures, voltages, and fan speeds, from the motherboard using inb(), outb(), inl(), etc. low level i/o functions. My challenge is to port that code over to run under Windows as a simple console app. But am puzzled in what functions Win32 (or .NET) provide that allow me permission to access direct memory mapped ports. I don't want to code a system driver either. My Windows tool preference is VS2008. (fyi) Is this possible?