WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Acces to parallel port  (Read 3367 times)

Offline ptetbien

  • Newbie
  • *
  • Posts: 3
Acces to parallel port
« on: April 11, 2010, 09:01:24 AM »
Hello everyone,

I use a tinycore on a CAPIO CA5 thin client. Every thing is working well (network, display, mouse...). I have installed the boot stuff on the original solidstate  ide DOC of the machine and it boots correctly.

But I have a problem to use the parallel port.

On boot, I have the following dmesg :

Quote
Linux version 2.6.29.1-tinycore (root@box) (gcc version 4.2.2) #1337 SMP Fri Apr 10 19:12:39 EEST 2009
KERNEL supported cpus:
  Intel GenuineIntel
  AMD AuthenticAMD
  NSC Geode by NSC
  Cyrix CyrixInstead
  Centaur CentaurHauls
  Transmeta GenuineTMx86
  Transmeta TransmetaCPU
  UMC UMC UMC UMC
CPU: vendor_id 'SiS SiS SiS ' unknown, using generic init.
CPU: Your system may be unstable.
PAT not supported by CPU.
PAT disabled. Not yet verified on this CPU type.
BIOS-provided physical RAM map:
 BIOS-e820: 0000000000000000 - 000000000009fc00 (usable)
 BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)
 BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)
 BIOS-e820: 0000000000100000 - 00000000037f0000 (usable)
 BIOS-e820: 00000000037f0000 - 00000000037f3000 (ACPI NVS)
 BIOS-e820: 00000000037f3000 - 0000000003800000 (ACPI data)
 BIOS-e820: 00000000ffff0000 - 0000000100000000 (reserved)
DMI 2.2 present.
Phoenix BIOS detected: BIOS may corrupt low RAM, working around it.
last_pfn = 0x37f0 max_arch_pfn = 0x100000
kernel direct mapping tables up to 37f0000 @ 10000-21000
RAMDISK: 0300c000 - 037df5b3
ACPI: RSDP 000F6600, 0014 (r0 AWARD )
ACPI: RSDT 037F3000, 0028 (r1 AWARD  AWRDACPI 42302E31 AWRD        0)
ACPI: FACP 037F3040, 0074 (r1 AWARD  AWRDACPI 42302E31 AWRD        0)
FADT: X_PM1a_EVT_BLK.bit_width (16) does not match PM1_EVT_LEN (4)
ACPI: DSDT 037F30C0, 2C44 (r1 AWARD  AWRDACPI     1000 MSFT  100000D)
ACPI: FACS 037F0000, 0040
0MB HIGHMEM available.
55MB LOWMEM available.
  mapped low ram: 0 - 037f0000
  low ram: 00000000 - 037f0000
  bootmap 0001b000 - 0001b700
(9 early reservations) ==> bootmem [0000000000 - 00037f0000]
  #0 [0000000000 - 0000001000]   BIOS data page ==> [0000000000 - 0000001000]
  #1 [0000001000 - 0000002000]    EX TRAMPOLINE ==> [0000001000 - 0000002000]
  #2 [0000006000 - 0000007000]       TRAMPOLINE ==> [0000006000 - 0000007000]
  #3 [0000100000 - 0000528674]    TEXT DATA BSS ==> [0000100000 - 0000528674]
  #4 [000300c000 - 00037df5b3]          RAMDISK ==> [000300c000 - 00037df5b3]
  #5 [0000529000 - 000052c000]    INIT_PG_TABLE ==> [0000529000 - 000052c000]
  #6 [000009fc00 - 0000100000]    BIOS reserved ==> [000009fc00 - 0000100000]
  #7 [0000010000 - 000001b000]          PGTABLE ==> [0000010000 - 000001b000]
  #8 [000001b000 - 000001c000]          BOOTMAP ==> [000001b000 - 000001c000]
Zone PFN ranges:
  DMA      0x00000010 -> 0x00001000
  Normal   0x00001000 -> 0x000037f0
  HighMem  0x000037f0 -> 0x000037f0
Movable zone start PFN for each node
early_node_map[2] active PFN ranges
    0: 0x00000010 -> 0x0000009f
    0: 0x00000100 -> 0x000037f0
On node 0 totalpages: 14207
free_area_init_node: node 0, pgdat c0450d80, node_mem_map c1000200
  DMA zone: 32 pages used for memmap
  DMA zone: 0 pages reserved
  DMA zone: 3951 pages, LIFO batch:0
  Normal zone: 80 pages used for memmap
  Normal zone: 10144 pages, LIFO batch:1
ACPI: PM-Timer IO Port: 0x5008
SMP: Allowing 1 CPUs, 0 hotplug CPUs
No local APIC present or hardware disabled
nr_irqs_gsi: 16
PM: Registered nosave memory: 000000000009f000 - 00000000000a0000
PM: Registered nosave memory: 00000000000a0000 - 00000000000f0000
PM: Registered nosave memory: 00000000000f0000 - 0000000000100000
Allocating PCI resources starting at 10000000 (gap: 3800000:fc7f0000)
NR_CPUS:8 nr_cpumask_bits:8 nr_cpu_ids:1 nr_node_ids:1
PERCPU: Allocating 32768 bytes of per cpu data
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 14095
Kernel command line: quiet norestore kmap=fr-latin9
Initializing CPU#0
PID hash table entries: 256 (order: 8, 1024 bytes)
Fast TSC calibration using PIT
Detected 199.501 MHz processor.
Console: colour VGA+ 80x25
console [tty0] enabled
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 43908k/57280k available (2433k kernel code, 12900k reserved, 1088k data, 344k init, 0k highmem)
virtual kernel memory layout:
    fixmap  : 0xfff50000 - 0xfffff000   ( 700 kB)
    pkmap   : 0xff800000 - 0xffc00000   (4096 kB)
    vmalloc : 0xc3ff0000 - 0xff7fe000   ( 952 MB)
    lowmem  : 0xc0000000 - 0xc37f0000   (  55 MB)
      .init : 0xc0477000 - 0xc04cd000   ( 344 kB)
      .data : 0xc0360468 - 0xc04707b0   (1088 kB)
      .text : 0xc0100000 - 0xc0360468   (2433 kB)
Checking if this processor honours the WP bit even in supervisor mode...Ok.
Calibrating delay loop (skipped), value calculated using timer frequency.. 399.62 BogoMIPS (lpj=665003)
Mount-cache hash table entries: 512
Checking 'hlt' instruction... OK.
SMP alternatives: switching to UP code
Freeing SMP alternatives: 9k freed
ACPI: Core revision 20081204
ACPI: setting ELCR to 0200 (from 8c00)
weird, boot CPU (#0) not listed by the BIOS.
SMP motherboard not detected.
Local APIC not detected. Using dummy APIC emulation.
SMP disabled
Brought up 1 CPUs
Total of 1 processors activated (399.62 BogoMIPS).
net_namespace: 944 bytes
NET: Registered protocol family 16
ACPI: bus type pci registered
PCI: PCI BIOS revision 2.10 entry at 0xfb5e0, last bus=1
PCI: Using configuration type 1 for base access
bio: create slab <bio-0> at 0
ACPI: EC: Look up EC in DSDT
ACPI: Interpreter enabled
ACPI: (supports S0 S1 S4 S5)
ACPI: Using PIC for interrupt routing
ACPI: No dock devices found.
ACPI: PCI Root Bridge [PCI0] (0000:00)
pci 0000:00:00.0: reg 10 32bit mmio: [0xe8000000-0xebffffff]
pci 0000:00:00.1: reg 10 io port: [0x1f0-0x1f3]
pci 0000:00:00.1: reg 14 io port: [0x3f4-0x3f7]
pci 0000:00:00.1: reg 18 io port: [0x170-0x173]
pci 0000:00:00.1: reg 1c io port: [0x374-0x377]
pci 0000:00:00.1: reg 20 io port: [0x4000-0x400f]
pci 0000:00:01.2: reg 10 32bit mmio: [0xec104000-0xec104fff]
pci 0000:00:01.4: reg 10 io port: [0xe000-0xe0ff]
pci 0000:00:01.4: reg 14 32bit mmio: [0xec100000-0xec103fff]
pci 0000:00:01.4: supports D1 D2
pci 0000:00:01.4: PME# supported from D0 D1 D2 D3hot D3cold
pci 0000:00:01.4: PME# disabled
pci 0000:00:0a.0: reg 10 io port: [0xe400-0xe4ff]
pci 0000:00:0a.0: reg 14 32bit mmio: [0xec105000-0xec1050ff]
pci 0000:00:0a.0: supports D1 D2
pci 0000:00:0a.0: PME# supported from D1 D2 D3hot D3cold
pci 0000:00:0a.0: PME# disabled
pci 0000:01:00.0: reg 10 32bit mmio: [0xe0000000-0xe7ffffff]
pci 0000:01:00.0: reg 14 32bit mmio: [0xec000000-0xec01ffff]
pci 0000:01:00.0: reg 18 io port: [0xd000-0xd07f]
pci 0000:01:00.0: supports D1 D2
pci 0000:00:02.0: bridge io port: [0xd000-0xdfff]
pci 0000:00:02.0: bridge 32bit mmio: [0xec000000-0xec0fffff]
pci 0000:00:02.0: bridge 32bit mmio pref: [0xe0000000-0xe7ffffff]
pci_bus 0000:00: on NUMA node 0
ACPI: PCI Interrupt Routing Table [\_SB_.PCI0._PRT]
ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 5 6 7 10 11 12 14 *15)
ACPI: PCI Interrupt Link [LNKB] (IRQs 3 4 5 6 7 10 *11 12 14 15)
ACPI: PCI Interrupt Link [LNKC] (IRQs 3 4 5 6 7 10 11 12 14 15) *0, disabled.
ACPI: PCI Interrupt Link [LNKD] (IRQs 3 4 5 6 7 *10 11 12 14 15)
ACPI: PCI Interrupt Link [LNKE] (IRQs 3 4 5 6 7 10 11 12 14 15) *0, disabled.
SCSI subsystem initialized
libata version 3.00 loaded.
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
PCI: Using ACPI for IRQ routing
pnp: PnP ACPI init
ACPI: bus type pnp registered
pnp: PnP ACPI: found 12 devices
ACPI: ACPI bus type pnp unregistered
PnPBIOS: Disabled by ACPI PNP
system 00:00: iomem range 0xf0000-0xf3fff could not be reserved
system 00:00: iomem range 0xf4000-0xf7fff could not be reserved
system 00:00: iomem range 0xf8000-0xfbfff could not be reserved
system 00:00: iomem range 0xfc000-0xfffff could not be reserved
system 00:00: iomem range 0x37f0000-0x37fffff could not be reserved
system 00:00: iomem range 0xffff0000-0xffffffff has been reserved
system 00:00: iomem range 0x0-0x9ffff could not be reserved
system 00:00: iomem range 0x100000-0x37effff could not be reserved
system 00:00: iomem range 0xffee0000-0xffefffff has been reserved
system 00:00: iomem range 0xfffe0000-0xfffeffff has been reserved
system 00:00: iomem range 0xfee00000-0xfee00fff has been reserved
system 00:02: ioport range 0x4d0-0x4d1 has been reserved
PM-Timer running at invalid rate: 50% of normal - aborting.
pci 0000:00:02.0: PCI bridge, secondary bus 0000:01
pci 0000:00:02.0:   IO window: 0xd000-0xdfff
pci 0000:00:02.0:   MEM window: 0xec000000-0xec0fffff
pci 0000:00:02.0:   PREFETCH window: 0x000000e0000000-0x000000e7ffffff
pci 0000:00:02.0: setting latency timer to 64
pci_bus 0000:00: resource 0 io:  [0x00-0xffff]
pci_bus 0000:00: resource 1 mem: [0x000000-0xffffffff]
pci_bus 0000:01: resource 0 io:  [0xd000-0xdfff]
pci_bus 0000:01: resource 1 mem: [0xec000000-0xec0fffff]
pci_bus 0000:01: resource 2 mem: [0xe0000000-0xe7ffffff]
pci_bus 0000:01: resource 3 mem: [0x0-0x0]
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 2, 16384 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
NET: Registered protocol family 1
checking if image is initramfs... it is
Freeing initrd memory: 8013k freed
fuse init (API version 7.11)
msgmni has been set to 101
alg: No test for stdrng (krng)
io scheduler noop registered
io scheduler deadline registered (default)
pci 0000:01:00.0: Boot video device
input: Power Button (FF) as /devices/LNXSYSTM:00/LNXPWRBN:00/input/input0
ACPI: Power Button (FF) [PWRF]
input: Power Button (CM) as /devices/LNXSYSTM:00/device:00/PNP0C0C:00/input/input1
ACPI: Power Button (CM) [PWRB]
input: Sleep Button (CM) as /devices/LNXSYSTM:00/device:00/PNP0C0E:00/input/input2
ACPI: Sleep Button (CM) [FUTS]
processor ACPI_CPU:00: registered as cooling_device0
isapnp: Scanning for PnP cards...
isapnp: No Plug & Play device found
Real Time Clock Driver v1.12b
Non-volatile memory driver v1.3
Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
serial8250: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
00:07: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
00:08: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
floppy0: no floppy controllers found
brd: module loaded
loop: loaded (max 80 devices)
PPP generic driver version 2.4.2
PPP Deflate Compression module registered
NET: Registered protocol family 24
tun: Universal TUN/TAP device driver, 1.6
tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
Uniform Multi-Platform E-IDE driver
SIS_IDE 0000:00:00.1: can't derive routing for PCI INT A
sis5513 0000:00:00.1: SiS550 ATA 100 (1st gen) controller
sis5513 0000:00:00.1: IDE controller (0x1039:0x5513 rev 0xd0)
sis5513 0000:00:00.1: IDE port disabled
sis5513 0000:00:00.1: not 100% native mode: will probe irqs later
    ide0: BM-DMA at 0x4000-0x4007
Probing IDE interface ide0...
hda: M-Systems iDOC V1.09, ATA DISK drive
hda: host max PIO4 wanted PIO255(auto-tune) selected PIO4
hda: MWDMA2 mode selected
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
ide_generic: please use "probe_mask=0x3f" module parameter for probing all legacy ISA IDE ports
ide-gd driver 1.18
hda: max request size: 128KiB
hda: 64000 sectors (32 MB) w/0KiB Cache, CHS=500/8/16
 hda: hda1
ide-cd driver 5.00
Driver 'sd' needs updating - please use bus_type methods
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
ACPI: PCI Interrupt Link [LNKD] enabled at IRQ 10
PCI: setting IRQ 10 as level-triggered
ohci_hcd 0000:00:01.2: PCI INT D -> Link[LNKD] -> GSI 10 (level, low) -> IRQ 10
ohci_hcd 0000:00:01.2: OHCI Host Controller
ohci_hcd 0000:00:01.2: new USB bus registered, assigned bus number 1
ohci_hcd 0000:00:01.2: irq 10, io mem 0xec104000
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 3 ports detected
uhci_hcd: USB Universal Host Controller Interface driver
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
PNP: PS/2 Controller [PNP0303:PS2K,PNP0f13:PS2M] at 0x60,0x64 irq 1,12
serio: i8042 KBD port at 0x60,0x64 irq 1
serio: i8042 AUX port at 0x60,0x64 irq 12
mice: PS/2 mouse device common for all mice
cpuidle: using governor ladder
cpuidle: using governor menu
padlock: VIA PadLock not detected.
padlock: VIA PadLock Hash Engine not detected.
usbcore: registered new interface driver hiddev
usbcore: registered new interface driver usbhid
usbhid: v2.6:USB HID core driver
ip_tables: (C) 2000-2006 Netfilter Core Team
TCP cubic registered
NET: Registered protocol family 17
NET: Registered protocol family 15
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
IO APIC resources could be not be allocated.
Using IPI No-Shortcut mode
input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input3
Freeing unused kernel memory: 344k freed
input: ImPS/2 Generic Wheel Mouse as /devices/platform/i8042/serio1/input/input4
8139cp: 10/100 PCI Ethernet driver v1.3 (Mar 22, 2004)
8139cp 0000:00:0a.0: This (id 10ec:8139 rev 10) is not an 8139C+ compatible chip, use 8139too
8139too Fast Ethernet driver 0.9.28
ACPI: PCI Interrupt Link [LNKA] enabled at IRQ 15
PCI: setting IRQ 15 as level-triggered
8139too 0000:00:0a.0: PCI INT A -> Link[LNKA] -> GSI 15 (level, low) -> IRQ 15
eth0: RealTek RTL8139 at 0xc407c000, 00:e0:c5:58:fd:4e, IRQ 15
eth0:  Identified 8139 chip type 'RTL-8100B/8139D'
parport_pc 00:09: reported by Plug and Play ACPI
parport0: PC-style at 0x3bc, irq 7 [PCSPP,TRISTATE]
parport1: PC-style at 0x378 [PCSPP]
squashfs: version 4.0 (2009/01/31) Phillip Lougher
eth0: link up, 10Mbps, half-duplex, lpa 0x0000


There is two little warnings :

The CPU code "SiS SiS SiS" is unknown.
The OI APIC resources are not available.

Otherwise, the parallel port #0 is deteted :

Quote
parport0: PC-style at 0x3bc, irq 7 [PCSPP,TRISTATE]

Here is the result of the lsmod command :

Quote
Module                  Size  Used by    Not tainted
squashfs               11732  4
scsi_wait_scan           260  0
parport_pc             18352  0
parport                18768  1 parport_pc
8139too                13640  0
8139cp                 10988  0

And the /proc/sys/dev/parport/parport0 directory seems to be well populated.

But I can't find any parport0 node in the /dev directory.

When I try to open the parport0, with the following  "C" program,

Code: [Select]
#include<unistd.h>
#include<stdio.h>
#include <sys/io.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

int main(int argc, char **argv)
{
    int fd;
    int mode; /* We'll need this later. */

    fd = open ("/dev/parport0", O_RDWR);
    if (fd == -1) {
        perror ("open");
        return 1;
    }
}

I have the result :
Quote
open: No such file or directory

When I manually create the parport node in /dev directory by
Quote
tc@box:/dev$ sudo mknod /dev/parport0 c 99 0

I obtient

Quote
open: No such device or address

I tried to boot on a usual PC, and the partport0 (or parport1) device also don't appear in the /dev directory. So I don't think to a harware problem.

Thanks for your help.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14815
Re: Acces to parallel port
« Reply #1 on: April 11, 2010, 09:35:01 AM »
I wonder if this has something to do with it:
Code: [Select]
/etc/udev/rules.d/50-udev-default.rules:SUBSYSTEM=="ppdev",             GROUP="staff"
/etc/udev/rules.d/80-drivers.rules:SUBSYSTEM=="module", KERNEL=="parport_pc", RUN+="/sbin/modprobe -b ppdev"
..but I'm no expert on udev

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: Acces to parallel port
« Reply #2 on: April 11, 2010, 10:49:35 AM »
User-space paraller port drivers (CONFIG_PPDEV) is not enabled in our config. What do you need to do that doesn't have a linux driver?
The only barriers that can stop you are the ones you create yourself.

Offline ptetbien

  • Newbie
  • *
  • Posts: 3
Re: Acces to parallel port
« Reply #3 on: April 11, 2010, 11:04:18 AM »
Thanks.

The both lines you indicate exists in the files in rules.d. But ppdev module doesn't exist in the tinycore distribution, and is not available in extensions.

I find lp module in /lib/modules/2.6.29.1-tinycore/drivers/char.

But lp is not enough for me. I would like to control the lines of the parallel interface for hardware application.

How to have ppdev module in a simple way ?

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: Acces to parallel port
« Reply #4 on: April 12, 2010, 06:34:23 AM »
You should be able to compile the module fairly easily (and make an extension, if you wish to make it available to others). IIRC it requires compiletc, bash and perl.

Download the patched kernel source and our config, enable ppdev as a module, "make modules" && "make INSTALL_MOD_PATH=/usr/local modules_install".

From here you can just pick the relevant module from /usr/local/lib/modules.
The only barriers that can stop you are the ones you create yourself.

Offline ptetbien

  • Newbie
  • *
  • Posts: 3
Re: Acces to parallel port
« Reply #5 on: April 12, 2010, 07:47:29 AM »
Thank you for your help. I'll do that and progress !