lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070120173644.GY24090@1wt.eu>
Date:	Sat, 20 Jan 2007 18:36:44 +0100
From:	Willy Tarreau <w@....eu>
To:	Joe Barr <joe@...rimer.com>
Cc:	Linux Kernel mailing List <linux-kernel@...r.kernel.org>
Subject: Re: Serial port blues

Hi,

On Fri, Jan 19, 2007 at 03:37:34PM -0600, Joe Barr wrote:
> 
> I'm forwarding this post by the author of a great little program for
> digital amateur radio on Linux, because I'm curious whether or not the
> problem he is seeing can be resolved outside the kernel.

At least, I see one wrong claim and one unexplored track in his report.
The wrong claim : the serial port can only be controled by the kernel.
It is totally wrong for true serial ports. If he does not want to use
ioctl(), then he can directly program the I/O port.

The unexplored track : he talked about nice -20. He did not seem to try
playing with sched_setscheduler(). I've been using this with a few programs
to get (close to) real-time responsiveness and it gives very good results.
Not sure whether it will work for his case, though, but it's easy to try,
basically, he just has to add this to the top of his program :

#include <sched.h>
...
main() {
  struct sched_param sch;

  /* see man sched_setscheduler for other options */
  sch.sched_priority = 1;
  if (sched_setscheduler(getpid(), SCHED_FIFO, &sch) == -1)
    perror("failed. Got root ?");

  /* rest of the program now running with real-time prio */
}

Now he must be careful about avoiding busy loops in the rest of the
program, or he will have to use the reset button.

> All comments welcome on/off list.
> 
> Thanks,
> Joe Barr
> K1GPL

[ rest stripped ]

Regards,
Willy

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ