Linux-Misc Digest #669, Volume #26               Sat, 30 Dec 00 22:13:02 EST

Contents:
  Re: How to get CPU usage (Michael Heiming)
  Linux version of Dos's debug ("Jack Kaufmann")
  apache server (Henning Pedersen)
  Re: determing modem connection speeds? (Bill Unruh)
  Re: echo a date value to a log... (Juergen Heinzl)
  Re: apache server ("Dan White")
  Re: Problem with GNOME ("Dan White")
  Re: Linux version of Dos's debug
  Re: Vim telnet problem. ("Dan White")
  Re: Linux version of Dos's debug (Jack Kaufmann)
  Re: soundblaster awe64 value (Michel Catudal)
  Re: Linux version of Dos's debug (Rod Haper)
  Re: serial/parallel port programming (Michel Catudal)

----------------------------------------------------------------------------

Date: Sun, 31 Dec 2000 01:01:09 +0100
From: Michael Heiming <[EMAIL PROTECTED]>
Subject: Re: How to get CPU usage

Just before someone complains about my usage of awk, it's of course:

ps aux | grep [.] | awk 'BEGIN {} { cpu += $3} END {print "CPU (Total): " cpu "%"}'

Michael Heiming


------------------------------

From: "Jack Kaufmann" <[EMAIL PROTECTED]>
Subject: Linux version of Dos's debug
Date: Sun, 31 Dec 2000 00:17:44 GMT

Is there a Linux equivalent to Dos's debug which allows viewing of binary
files in hex format?



------------------------------

From: Henning Pedersen <[EMAIL PROTECTED]>
Subject: apache server
Date: Sat, 30 Dec 2000 19:11:22 -0500

I have an Apache server running on Redhat 6.2 and it works fine with simple
HTML pages, but when I try to use CGI scripts I get a 403 error. In the
httpd error log it says that its because of restricted access and that I can
clearly understand but how and where do I change it so that I can let people
run the cgi scripts without this error message?
I know that the directory is correct in the httpd.conf for cgi-bin so its
not that.

Thanks in advance.

Henning Pedersen


------------------------------

From: [EMAIL PROTECTED] (Bill Unruh)
Subject: Re: determing modem connection speeds?
Date: 31 Dec 2000 00:26:01 GMT

In <92j1nr$2bh$[EMAIL PROTECTED]> Paul Fairless <[EMAIL PROTECTED]> writes:

>i was trying to find out if there is a way to get pppd (2.3.10) to
>report the connection speed that it got when it hooked up to your isp?

No. There is nothing there to get that speed. IF you send teh right
setup commands to your modem, then after the CONNECT report (in the chat
-v output) it may list the connection speed-- either computer to modem,
or modem to modem depending on how you set up your modem.


>i've got the output going to syslog at the moment so i see all the:


>Dec 29 21:08:46 homer pppd[137]: rcvd [IPCP ConfRej id=0x1 <compress VJ
>0f 01>]

This is the wrong output It is the ouput from pppd. There is no way ppd
even could tell you what the speed is. 

------------------------------

From: [EMAIL PROTECTED] (Juergen Heinzl)
Subject: Re: echo a date value to a log...
Date: 31 Dec 2000 01:20:40 GMT

In article <92l8oh$kee$[EMAIL PROTECTED]>, HellNo wrote:
>Hi all,
>
>I'm running on a RH6.2 i386
>
>I've written a basic batch file and at the end of it, i'd like to add a
>line that will add an event to /var/log/messages
>
>Problem is, I just can't output the date to "messages"... By now you
>should realise I am very very new to all of this.
>
>Anyway... this is what I did:
>echo date $HOSTNAME "Yi["$PPID"]: Starting Yi.org" >> /var/log/messages
[-]
You may not use echo here since messages is often being written to
by syslog. If so, then use logger, e.g. like this ...

echo `date` $HOSTNAME "Yi["$PPID"]: Starting Yi.org" \
/sbin/logger -i -p user.notice -t Yiorg

... and mind the `date` syntax.

Ta',
Juergen

-- 
\ Real name     : J�rgen Heinzl         \       no flames      /
 \ EMail Private : [EMAIL PROTECTED] \ send money instead /

------------------------------

From: "Dan White" <[EMAIL PROTECTED]>
Subject: Re: apache server
Date: Sun, 31 Dec 2000 01:28:44 GMT

In article <[EMAIL PROTECTED]>, "Henning Pedersen"
<[EMAIL PROTECTED]> wrote:

> I have an Apache server running on Redhat 6.2 and it works fine with
> simple HTML pages, but when I try to use CGI scripts I get a 403 error.
> In the httpd error log it says that its because of restricted access and
> that I can clearly understand but how and where do I change it so that I
> can let people run the cgi scripts without this error message? I know
> that the directory is correct in the httpd.conf for cgi-bin so its not
> that.

The directory that your cgi-bin scripts are in needs to have the access
'x' permissions bit set for the user which runs apache. The script itself
will need to be at least readable by the same user, and any parent
directories will also need the 'x' bit set (e.g. chmod 751 /dir).

- Dan White

------------------------------

From: "Dan White" <[EMAIL PROTECTED]>
Subject: Re: Problem with GNOME
Date: Sun, 31 Dec 2000 01:33:04 GMT

In article <92lqme$1v0$[EMAIL PROTECTED]>, "Big Fish"
<[EMAIL PROTECTED]> wrote:

> Hi,
> 
> I am using RedHat Linux 6.0. I have been having trouble lately using my
> GNOME windows manager. 

The version of GNOME which came with Redhat 6.0 was known to be a little
buggy. You should check out Helix Code (http://www.helixcode.com) which
can help you easily install the latest greatest GNOME for your Redhat 6.0
system.

- Dan White

------------------------------

From: [EMAIL PROTECTED] ()
Subject: Re: Linux version of Dos's debug
Date: Sun, 31 Dec 2000 01:37:28 -0000

In article <IWu36.1285$[EMAIL PROTECTED]>,
        "Jack Kaufmann" <[EMAIL PROTECTED]> writes:
> Is there a Linux equivalent to Dos's debug which allows viewing of binary
> files in hex format?
> 
 Good old emacs will work.

------------------------------

From: "Dan White" <[EMAIL PROTECTED]>
Subject: Re: Vim telnet problem.
Date: Sun, 31 Dec 2000 01:39:56 GMT

In article <[EMAIL PROTECTED]>, "Carfield Yim"
<[EMAIL PROTECTED]> wrote:

> Robert Kiesling wrote:
>> 
>> Carfield Yim <[EMAIL PROTECTED]> writes:
>> 
>> > I can't use vim when I telnet to my machine, but using vi is ok. I
>> > think that the reason is the type of terminal set at linux telnetd
>> > don't support colour text. How can I set it correctly?
>> 
>> You'd be better off talking to the vim experts on comp.editors.
>> 
>> --
>> Robert Kiesling <[EMAIL PROTECTED]> Web Page : 
>> http://www.mainmatter.com/kiesling Linux FAQ:
>> http://www.mainmatter.com/linux-faq/toc.html 
>> http://www.mainmatter.com/
>> ---
>> Tired of spam?  Please forward messages to [EMAIL PROTECTED]
> 
> 
> I ask the question because I afraid it is Linux setting problem... May I
> post same thing at comp.editor

Try:

export TERM=vt220

before running vim.

- Dan White

------------------------------

From: Jack Kaufmann <[EMAIL PROTECTED]>
Subject: Re: Linux version of Dos's debug
Date: Sun, 31 Dec 2000 02:30:17 GMT

[EMAIL PROTECTED] wrote:
> 
> In article <IWu36.1285$[EMAIL PROTECTED]>,
>         "Jack Kaufmann" <[EMAIL PROTECTED]> writes:
> > Is there a Linux equivalent to Dos's debug which allows viewing of binary
> > files in hex format?
> >
>  Good old emacs will work.

How?  All I get is text-mode gibberish.

------------------------------

From: Michel Catudal <[EMAIL PROTECTED]>
Subject: Re: soundblaster awe64 value
Date: 30 Dec 2000 20:44:11 -0600

Paul Wilson a �crit :
> 
> I'm running Red Hat 6.1 on a Pentium II 450 system with a windows
> partition. I'm having difficulty enabling the system sounds with my
> Soundblaster AWE64 Value card. I can play CDs with no problem. As far as
> I can tell, the appropriate modules are loaded, except for the op13
> module. It's in my conf.modules file, but when I cat it under
> /lib/modules/2.2.12-20/misc, I get a "no such file or directory" error.
> Here's an lsmod of the installed modules:
> 
> Module  Size  Used by
> awe_wave 157804    1
> sb  33620    1
> uart401   5968    1  [sb]
> sound  57240    0  [awe_wave sb uart401]
> soundlow   300         0  [sound]
> soundcore  2372    7  [sb sound]
> 
> My conf.modules is:
> options op13 io=0x388
> alias sound sb
> pre-install sound /sbin/insmod sound dmabuf=1
> options op13 io=0x388
> alias midi awe_wave
> post-install awe_wave /bin/sfxload /etc/midi/GU11-ROM.SF2
> options sb io=0x240 irq=7 dma=0 dma16=6 mpu_io=0x300
> 
> When I go to the control center in either KDE or GNOME, the test of the
> .wav files produces nothing. When I initially ran sndconfig, both tests
> worked with no problem. I did a "chmod ugo+x" on all the .wav files in
> the /usr/share/sounds directory. Still nothing.
> 
> I have 2 questions:
> 1) With this information, can anyone tell why the system sounds are not
> working?
> 
> 2) What is the function of the op13 module, and why is it not listed
> with the other modules, even though it's configured in conf.modules? I
> think that this module may have to do with why my sounds aren't working.
> 
> Thanks,
> Paul


I have the exact same card but I run it on SuSE Linux 7.0 Professional
Your irq 7 might be wrong.

My /etc/isapnp.conf file :

=====================================================

# $Id: pnpdump.c,v 1.20 1999/12/02 22:39:24 fox Exp $
# Release isapnptools-1.20
# This is free software, see the sources for details.
# This software has NO WARRANTY, use at your OWN RISK
#
# For details of this file format, see isapnp.conf(5)
#
# For latest information and FAQ on isapnp and pnpdump see:
# http://www.roestock.demon.co.uk/isapnptools/
#
# Compiler flags: -DREALTIME -DNEEDSETSCHEDULER -DABORT_ONRESERR
#
# Trying port address 0273
# Board 1 has serial identifier 67 1d 8f 43 c9 e4 00 8c 0e

# (DEBUG)
(READPORT 0x0273)
(ISOLATE PRESERVE)
(IDENTIFY *)
(VERBOSITY 2)
(CONFLICT (IO FATAL)(IRQ FATAL)(DMA FATAL)(MEM FATAL)) # or WARNING

# Card 1: (serial identifier 67 1d 8f 43 c9 e4 00 8c 0e)
# Vendor Id CTL00e4, Serial Number 495928265, checksum 0x67.
# Version 1.0, Vendor version 1.0
# ANSI string -->Creative SB AWE64  PnP<--
# Vendor defined tag:  73 02 45 20
#
# Logical device id CTL0045
#     Device supports vendor reserved register @ 0x3b
#     Device supports vendor reserved register @ 0x3d
#     Device supports vendor reserved register @ 0x3f
#
# Edit the entries below to uncomment out the configuration required.
# Note that only the first value of any range is given, this may be changed if required
# Don't forget to uncomment the activate (ACT Y) when happy

(CONFIGURE CTL00e4/495928265 (LD 0
#     ANSI string -->Audio<--

# Multiple choice time, choose one only !

#     Start dependent functions: priority preferred
#       IRQ 5.
#             High true, edge sensitive interrupt (by default)
  (INT 0 (IRQ 5 (MODE +E)))
#       First DMA channel 1.
#             8 bit DMA only
#             Logical device is a bus master
#             DMA may execute in count by byte mode
#             DMA may not execute in count by word mode
#             DMA channel speed in compatible mode
  (DMA 0 (CHANNEL 1))
#       Next DMA channel 5.
#             16 bit DMA only
#             Logical device is a bus master
#             DMA may not execute in count by byte mode
#             DMA may execute in count by word mode
#             DMA channel speed in compatible mode
  (DMA 1 (CHANNEL 5))
#       Logical device decodes 16 bit IO address lines
#             Minimum IO base address 0x0220
#             Maximum IO base address 0x0220
#             IO base alignment 1 bytes
#             Number of IO addresses required: 16
  (IO 0 (SIZE 16) (BASE 0x0220))
#       Logical device decodes 16 bit IO address lines
#             Minimum IO base address 0x0330
#             Maximum IO base address 0x0330
#             IO base alignment 1 bytes
#             Number of IO addresses required: 2
  (IO 1 (SIZE 2) (BASE 0x0330))
#       Logical device decodes 16 bit IO address lines
#             Minimum IO base address 0x0388
#             Maximum IO base address 0x0388
#             IO base alignment 1 bytes
#             Number of IO addresses required: 4
  (IO 2 (SIZE 4) (BASE 0x0388))

#       Start dependent functions: priority acceptable
#       IRQ 5, 7, 9 or 10.
#             High true, edge sensitive interrupt (by default)
# (INT 0 (IRQ 5 (MODE +E)))
#       First DMA channel 0, 1 or 3.
#             8 bit DMA only
#             Logical device is not a bus master
#             DMA may execute in count by byte mode
#             DMA may not execute in count by word mode
#             DMA channel speed in compatible mode
# (DMA 0 (CHANNEL 0))
#       Next DMA channel 5, 6 or 7.
#             16 bit DMA only
#             Logical device is a bus master
#             DMA may not execute in count by byte mode
#             DMA may execute in count by word mode
#             DMA channel speed in compatible mode
# (DMA 1 (CHANNEL 5))
#       Logical device decodes 16 bit IO address lines
#             Minimum IO base address 0x0220
#             Maximum IO base address 0x0280
#             IO base alignment 32 bytes
#             Number of IO addresses required: 16
# (IO 0 (SIZE 16) (BASE 0x0220))
#       Logical device decodes 16 bit IO address lines
#             Minimum IO base address 0x0300
#             Maximum IO base address 0x0330
#             IO base alignment 48 bytes
#             Number of IO addresses required: 2
# (IO 1 (SIZE 2) (BASE 0x0300))
#       Logical device decodes 16 bit IO address lines
#             Minimum IO base address 0x0388
#             Maximum IO base address 0x0388
#             IO base alignment 1 bytes
#             Number of IO addresses required: 4
# (IO 2 (SIZE 4) (BASE 0x0388))

#       Start dependent functions: priority acceptable
#       IRQ 5, 7, 9 or 10.
#             High true, edge sensitive interrupt (by default)
# (INT 0 (IRQ 5 (MODE +E)))
#       First DMA channel 0, 1 or 3.
#             8 bit DMA only
#             Logical device is a bus master
#             DMA may execute in count by byte mode
#             DMA may not execute in count by word mode
#             DMA channel speed in compatible mode
# (DMA 0 (CHANNEL 0))
#       Next DMA channel 5, 6 or 7.
#             16 bit DMA only
#             Logical device is a bus master
#             DMA may not execute in count by byte mode
#             DMA may execute in count by word mode
#             DMA channel speed in compatible mode
# (DMA 1 (CHANNEL 5))
#       Logical device decodes 16 bit IO address lines
#             Minimum IO base address 0x0220
#             Maximum IO base address 0x0280
#             IO base alignment 32 bytes
#             Number of IO addresses required: 16
# (IO 0 (SIZE 16) (BASE 0x0220))
#       Logical device decodes 16 bit IO address lines
#             Minimum IO base address 0x0300
#             Maximum IO base address 0x0330
#             IO base alignment 48 bytes
#             Number of IO addresses required: 2
# (IO 1 (SIZE 2) (BASE 0x0300))

#       Start dependent functions: priority acceptable
#       IRQ 5, 7, 9 or 10.
#             High true, edge sensitive interrupt (by default)
# (INT 0 (IRQ 5 (MODE +E)))
#       First DMA channel 0, 1 or 3.
#             8 bit DMA only
#             Logical device is a bus master
#             DMA may execute in count by byte mode
#             DMA may not execute in count by word mode
#             DMA channel speed in compatible mode
# (DMA 0 (CHANNEL 0))
#       Next DMA channel 5, 6 or 7.
#             16 bit DMA only
#             Logical device is a bus master
#             DMA may not execute in count by byte mode
#             DMA may execute in count by word mode
#             DMA channel speed in compatible mode
# (DMA 1 (CHANNEL 5))
#       Logical device decodes 16 bit IO address lines
#             Minimum IO base address 0x0220
#             Maximum IO base address 0x0280
#             IO base alignment 32 bytes
#             Number of IO addresses required: 16
# (IO 0 (SIZE 16) (BASE 0x0220))

#       Start dependent functions: priority acceptable
#       IRQ 5, 7, 9 or 10.
#             High true, edge sensitive interrupt (by default)
# (INT 0 (IRQ 5 (MODE +E)))
#       First DMA channel 0, 1 or 3.
#             8 bit DMA only
#             Logical device is a bus master
#             DMA may execute in count by byte mode
#             DMA may not execute in count by word mode
#             DMA channel speed in compatible mode
# (DMA 0 (CHANNEL 0))
#       Logical device decodes 16 bit IO address lines
#             Minimum IO base address 0x0220
#             Maximum IO base address 0x0280
#             IO base alignment 32 bytes
#             Number of IO addresses required: 16
# (IO 0 (SIZE 16) (BASE 0x0220))
#       Logical device decodes 16 bit IO address lines
#             Minimum IO base address 0x0300
#             Maximum IO base address 0x0330
#             IO base alignment 48 bytes
#             Number of IO addresses required: 2
# (IO 1 (SIZE 2) (BASE 0x0300))
#       Logical device decodes 16 bit IO address lines
#             Minimum IO base address 0x0388
#             Maximum IO base address 0x0388
#             IO base alignment 1 bytes
#             Number of IO addresses required: 4
# (IO 2 (SIZE 4) (BASE 0x0388))

#       Start dependent functions: priority acceptable
#       IRQ 5, 7, 9 or 10.
#             High true, edge sensitive interrupt (by default)
# (INT 0 (IRQ 5 (MODE +E)))
#       First DMA channel 0, 1 or 3.
#             8 bit DMA only
#             Logical device is a bus master
#             DMA may execute in count by byte mode
#             DMA may not execute in count by word mode
#             DMA channel speed in compatible mode
# (DMA 0 (CHANNEL 0))
#       Logical device decodes 16 bit IO address lines
#             Minimum IO base address 0x0220
#             Maximum IO base address 0x0280
#             IO base alignment 32 bytes
#             Number of IO addresses required: 16
# (IO 0 (SIZE 16) (BASE 0x0220))
#       Logical device decodes 16 bit IO address lines
#             Minimum IO base address 0x0300
#             Maximum IO base address 0x0330
#             IO base alignment 48 bytes
#             Number of IO addresses required: 2
# (IO 1 (SIZE 2) (BASE 0x0300))

#       Start dependent functions: priority acceptable
#       IRQ 5, 7, 9 or 10.
#             High true, edge sensitive interrupt (by default)
# (INT 0 (IRQ 5 (MODE +E)))
#       First DMA channel 0, 1 or 3.
#             8 bit DMA only
#             Logical device is a bus master
#             DMA may execute in count by byte mode
#             DMA may not execute in count by word mode
#             DMA channel speed in compatible mode
# (DMA 0 (CHANNEL 0))
#       Logical device decodes 16 bit IO address lines
#             Minimum IO base address 0x0220
#             Maximum IO base address 0x0280
#             IO base alignment 32 bytes
#             Number of IO addresses required: 16
# (IO 0 (SIZE 16) (BASE 0x0220))

#       Start dependent functions: priority functional
#       IRQ 5, 7, 9 or 10.
#             High true, edge sensitive interrupt (by default)
# (INT 0 (IRQ 5 (MODE +E)))
#       First DMA channel 0, 1 or 3.
#             8 bit DMA only
#             Logical device is a bus master
#             DMA may execute in count by byte mode
#             DMA may not execute in count by word mode
#             DMA channel speed in compatible mode
# (DMA 0 (CHANNEL 0))
#       Next DMA channel 5, 6 or 7.
#             16 bit DMA only
#             Logical device is a bus master
#             DMA may not execute in count by byte mode
#             DMA may execute in count by word mode
#             DMA channel speed in compatible mode
# (DMA 1 (CHANNEL 5))
#       Logical device decodes 16 bit IO address lines
#             Minimum IO base address 0x0220
#             Maximum IO base address 0x0280
#             IO base alignment 32 bytes
#             Number of IO addresses required: 16
# (IO 0 (SIZE 16) (BASE 0x0220))
#       Logical device decodes 16 bit IO address lines
#             Minimum IO base address 0x0300
#             Maximum IO base address 0x0330
#             IO base alignment 16 bytes
#             Number of IO addresses required: 2
# (IO 1 (SIZE 2) (BASE 0x0300))
#       Logical device decodes 16 bit IO address lines
#             Minimum IO base address 0x0388
#             Maximum IO base address 0x0394
#             IO base alignment 4 bytes
#             Number of IO addresses required: 4
# (IO 2 (SIZE 4) (BASE 0x0388))

#     End dependent functions
 (NAME "CTL00e4/495928265[0]{Audio               }")
  (ACT Y)
))
#
# Logical device id CTL7002
#     Device supports vendor reserved register @ 0x3b
#     Device supports vendor reserved register @ 0x3d
#     Device supports vendor reserved register @ 0x3f
#
# Edit the entries below to uncomment out the configuration required.
# Note that only the first value of any range is given, this may be changed if required
# Don't forget to uncomment the activate (ACT Y) when happy

(CONFIGURE CTL00e4/495928265 (LD 1
#     Compatible device id PNPb02f
#     ANSI string -->Game<--

# Multiple choice time, choose one only !

#     Start dependent functions: priority preferred
#       Logical device decodes 16 bit IO address lines
#             Minimum IO base address 0x0200
#             Maximum IO base address 0x0200
#             IO base alignment 1 bytes
#             Number of IO addresses required: 8
  (IO 0 (SIZE 8) (BASE 0x0200))

#       Start dependent functions: priority acceptable
#       Logical device decodes 16 bit IO address lines
#             Minimum IO base address 0x0200
#             Maximum IO base address 0x0208
#             IO base alignment 8 bytes
#             Number of IO addresses required: 8
# (IO 0 (SIZE 8) (BASE 0x0200))

#     End dependent functions
 (NAME "CTL00e4/495928265[1]{Game                }")
  (ACT Y)
))
#
# Logical device id CTL0022
#     Device supports vendor reserved register @ 0x3b
#     Device supports vendor reserved register @ 0x3d
#     Device supports vendor reserved register @ 0x3f
#
# Edit the entries below to uncomment out the configuration required.
# Note that only the first value of any range is given, this may be changed if required
# Don't forget to uncomment the activate (ACT Y) when happy

(CONFIGURE CTL00e4/495928265 (LD 2
#     ANSI string -->WaveTable<--

# Multiple choice time, choose one only !

#     Start dependent functions: priority preferred
#       Logical device decodes 16 bit IO address lines
#             Minimum IO base address 0x0620
#             Maximum IO base address 0x0620
#             IO base alignment 1 bytes
#             Number of IO addresses required: 4
(IO 0 (BASE 0x620)) (IO 1 (BASE 0x0A20)) (IO 2 (BASE 0x0E20))

#       Start dependent functions: priority acceptable
#       Logical device decodes 16 bit IO address lines
#             Minimum IO base address 0x0620
#             Maximum IO base address 0x0680
#             IO base alignment 32 bytes
#             Number of IO addresses required: 4
# (IO 0 (SIZE 4) (BASE 0x0620))

#     End dependent functions
#     Vendor defined tag:  75 01 69 46 35 55
 (NAME "CTL00e4/495928265[2]{WaveTable           }")
  (ACT Y)
))
# End tag... Checksum 0x00 (OK)

# Returns all cards to the "Wait for Key" state
(WAITFORKEY)

====================================


in /etc/modules.conf I have :

#*****************************************************************************
#    module : sb.o               Soundblaster 16, SB Pro + Clones
#                                Also needed for AWE32/64 
#
#    Documentation available in /usr/src/linux/Documentation/sound/Soundblaster
#    and in /usr/src/linux/drivers/sound/sb.c .
#
#    Possible configuration :
#
alias char-major-14 sb
post-install sb /sbin/modprobe "-k" "adlib_card"
options sb io=0x220 irq=5 dma=1 dma16=5 mpu_io=0x330
options adlib_card io=0x388


conf.modules is just a symbolic link to modules.conf

========                                                                   
Tired of Microsoft's rebootive multitasking?
then it's time to upgrade to Linux.
http://www.netonecom.net/~bbcat
We have all kinds of links
and many SuSE 7.0 Linux RPM packages

------------------------------

From: Rod Haper <[EMAIL PROTECTED]>
Subject: Re: Linux version of Dos's debug
Date: Sun, 31 Dec 2000 02:36:05 GMT

Jack Kaufmann wrote:
> 
> Is there a Linux equivalent to Dos's debug which allows viewing of binary
> files in hex format?

Have a look at the standard Unix od utility.

------------------------------

From: Michel Catudal <[EMAIL PROTECTED]>
Subject: Re: serial/parallel port programming
Date: 30 Dec 2000 20:59:09 -0600

[EMAIL PROTECTED] a �crit :
> 
> Hi
> 
> Has someone of you all there a small example of sending instructions
> over a serial or parallel port? I need a simple idea (in c/perl) just
> to set some lines high or low.
> 
> pls mail to [EMAIL PROTECTED] because I am not here so often...
> 

To work in user mode you'll need to add the ppdev kernel modules if you are not using 
kernel 2.4
Check on my web site on the first Linux page for the proper module

Here is an example of some code, download my AVR microcontroller programmer to see 
more.
I use ioctl to access /dev/parport1 which is a Lava PCI parallel card. You can change
the code to use /dev/parport0 instead
The reason I am using the kernel module is that is the only way to access the port in
user mode. You have to be on root otherwise. It works very well this way.

unsigned char parallel::wr2SPI(unsigned char c)
{
   unsigned char x = 0;
   unsigned char send_mask = 128; // spi chars are sent msb first
   unsigned char status;
   int i;
   for (i = 0; i <= 7; i++)
       {
       // put a bit out on MOSI
       // point to a specific bit in c, if it is HIGH
       // set the MOSI bit HIGH
       if (c & send_mask) avrCtrl |= MOSI_HIGH;
       // otherwise, set the MOSI bit LOW
       else avrCtrl &= MOSI_LOW;
       // now, set the port bits
       ioctl(prtPort, PPWDATA, &avrCtrl);
       // point to next bit for the next send
       send_mask >>= 1;
       // ready a new bit position to receive a bit on MISO
       x <<= 1;
       // take in a bit on MISO
       // if the bit is HIGH, set the corresponding bit in x HIGH
       // otherwise, there's already a LOW there from the previous left-shift
       // so no action is needed
       ioctl(prtPort, PPRSTATUS, &status);
       if (status & MISO_HIGH) x++;
       // set the clock (SCK) line to HIGH
       avrCtrl |= SCK_HIGH;
       ioctl(prtPort, PPWDATA, &avrCtrl);
       // set the clock (SCK) line to LOW
       avrCtrl &= SCK_LOW;
       ioctl(prtPort, PPWDATA, &avrCtrl);
       }
   return x;
}                                                                                      
                         

-- 
Tired of Microsoft's rebootive multitasking?
then it's time to upgrade to Linux.
http://www.netonecom.net/~bbcat
We have all kinds of links
and many SuSE 7.0 Linux RPM packages

------------------------------


** FOR YOUR REFERENCE **

The service address, to which questions about the list itself and requests
to be added to or deleted from it should be directed, is:

    Internet: [EMAIL PROTECTED]

You can send mail to the entire list by posting to comp.os.linux.misc.

Linux may be obtained via one of these FTP sites:
    ftp.funet.fi                                pub/Linux
    tsx-11.mit.edu                              pub/linux
    sunsite.unc.edu                             pub/Linux

End of Linux-Misc Digest
******************************

Reply via email to