Serial Port access from kernel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Hello,

Is there any way to access the serial port from within kernel code? I
came across this code, while googling, which is supposedly dangerous.

> struct file *filp;
> mm_segment_t old_fs;
> filp = filp_open(name,flags,mode);
> old_fs= getfs();
> set_fs(KERNEL_DS);
> filp->f_op->read(filp,buffer,count,&filp->f_pos);

(from: http://mail.nl.linux.org/kernelnewbies/2001-02/msg00068.html)

Morever, I don't have a filesystem in the kernel, and so I guess, this
won't work. Is there any other way?

One way, I could think of, is to make the static functions used
``internally'' by the driver, public (non-static) and using those
functions directly; but I am not sure if this is the best way out.

chyrag.
-- 
Chirag Kantharia, symonds.net/~chyrag/

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux