developing UART drivers on Linux? - Linux

This is a discussion on developing UART drivers on Linux? - Linux ; Hello, My CPU is VIA chipset. I want to change DOS UART driver of 16c552 to work on Linux... (16c552 support 2 serial channel (2 IO PORTS) for each chip set) ( It is not com1 ~ com2 port , ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: developing UART drivers on Linux?

  1. developing UART drivers on Linux?

    Hello,
    My CPU is VIA chipset.
    I want to change DOS UART driver of 16c552 to work on Linux...
    (16c552 support 2 serial channel (2 IO PORTS) for each chip set)
    ( It is not com1 ~ com2 port , it is just UART level driver )


    I'd like to know both way is possible or not and which way is more proper?

    First way,
    Accessing from kernel module (kernel space ).

    I'd like to know these 2 IO PORT Address UART Registors used in
    DOS can access from module_init() function
    without registering device name with minor number and device
    name
    to set something with outp() fucntion such as baudrate and data
    bits and parity bit?

    Is it possible?


    Second way,
    Accessing from userspace without any device driver related 16c552.

    Can I access these 2 IO ports address and UART Registors used in DOS
    from user spacce program directlry, using ioperm ?
    And Can I use request_irq() and enable_irq() and disable_irq() from
    userspace?

    Is it possible?


    *PS) Where can I see short and simple skelton code for UART driver of any
    kind of uart chips?
    ( it's not COM1,COM2 , just UART Level )

    Have a nice day.



  2. Re: developing UART drivers on Linux?

    On a sunny day (Tue, 19 Jun 2007 03:39:12 +0900) it happened "google-rambo88"
    wrote in :

    get a Linux kernel from www.linux.org, maybe you already have source installed:

    cd /usr/src/linux/drivers/serial/
    You need to write a module to access interrups etc...
    Yes you can access IO from userspace, but without interrupts.


  3. Re: developing UART drivers on Linux?

    google-rambo88 writes:
    > I want to change DOS UART driver of 16c552 to work on Linux...
    > (16c552 support 2 serial channel (2 IO PORTS) for each chip set)



    toncho//usr/src/linux grep -ri 16c552 *
    drivers/pci/pci.ids: d84d 4078 EX-4078 2S(16C552) RS-232+1P
    include/asm-mips/jazz.h: * Serial and parallel ports (WD 16C552) on the Mips JAZZ
    prio:drivers/pci/pci.ids: d84d 4078 EX-4078 2S(16C552) RS-232+1P

    --
    John Hasler
    john@dhh.gt.org
    Dancing Horse Hill
    Elmwood, WI USA

  4. Re: developing UART drivers on Linux?

    On Jun 18, 11:39 am, "google-rambo88" wrote:

    > I want to change DOS UART driver of 16c552 to work on Linux...
    > (16c552 support 2 serial channel (2 IO PORTS) for each chip set)
    > ( It is not com1 ~ com2 port , it is just UART level driver )


    This is not a good idea for two reasons:

    1) Such a driver already exists, so the exercise is pointless.

    2) The right place to start when making a driver is only some other
    driver if the two OSes are very similar. DOS and Linux are not at all
    similar. The right place to start is another similar driver for Linux
    and the hardware specifications.

    > Second way,
    > Accessing from userspace without any device driver related 16c552.
    > Can I access these 2 IO ports address and UART Registors used in DOS
    > from user spacce program directlry, using ioperm ?
    > And Can I use request_irq() and enable_irq() and disable_irq() from
    > userspace?
    >
    > Is it possible?


    No, that's probably impossible. Respoding to IRQs is userspace is
    basically impossible and controlling most hardware from userspace is
    basically impossible. The problems mainly focus around meeting timing
    requirements and not having the hardware state change when you're not
    looking.

    > *PS) Where can I see short and simple skelton code for UART driver of any
    > kind of uart chips?
    > ( it's not COM1,COM2 , just UART Level )


    Get the Linux source and look in drivers/serial.

    DS


+ Reply to Thread