Linux-Development-Sys Digest #446, Volume #8     Sat, 27 Jan 01 07:13:15 EST

Contents:
  getche() (Filipe Maia)
  Re: getche() (George Houpis)
  Re: Kernel 2.4.0 crash at startup (Jerry Peters)
  Re: Help to get microseconds cputime precision (Johnny Choque)
  Re: Help to get microseconds cputime precision (Robert Redelmeier)
  Re: Having trouble compiling tulip.c in RedHat 7 (Warren Young)
  Re: Only 64Mb??? (Warren Young)
  Re: cfdisk ("Ken Wilson")
  Re: Having trouble compiling tulip.c in RedHat 7 (jtnews)
  How to build a USB rescue floppy disk ([EMAIL PROTECTED])
  Re: How to build a USB rescue floppy disk ([EMAIL PROTECTED])
  Re: A Linux disaster! ([EMAIL PROTECTED])
  Re: Help to get microseconds cputime precision (Nate Eldredge)
  SEND DIAGNOSTIC and RECEIVE DIAGNOSTIC RESULT (Marty)
  CDROM driver (Ylt007)
  Linux Kernel book about linux 2.0 still useful?? (Carfield Yim)
  Re: how can i modify kernel memory at runtime (Kasper Dupont)
  Re: Accessing Kernel Process Structs from a Module (Kasper Dupont)
  Re: getche() (root)
  Re: Why does my e2fs always fsck bad? (Kasper Dupont)
  Re: Debugging "outb" and "inb" (Kasper Dupont)

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

From: Filipe Maia <[EMAIL PROTECTED]>
Subject: getche()
Date: Fri, 26 Jan 2001 20:41:59 +0000

Is there a equivelant linux function for the windows getche from conio.h?
I am newbie in programming and i am having some difficulties in porting code
from win to linux.
Can someone help me?

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

From: George Houpis <[EMAIL PROTECTED]>
Subject: Re: getche()
Date: Fri, 26 Jan 2001 14:52:59 -0600

Try getchar().  If you need it without blocking or without echoing, then you
have more work to do, i.e. you need to setup terminal modes.

getchar() need #include <stdio.h>, Linux does not use conio.h, that is unique
to DOS...

Welcome to the better programming environment.

George



Filipe Maia wrote:

> Is there a equivelant linux function for the windows getche from conio.h?
> I am newbie in programming and i am having some difficulties in porting code
> from win to linux.
> Can someone help me?




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

From: Jerry Peters <[EMAIL PROTECTED]>
Subject: Re: Kernel 2.4.0 crash at startup
Date: Fri, 26 Jan 2001 21:10:06 GMT

Michel Talon <[EMAIL PROTECTED]> wrote:
> Christian Tardif <[EMAIL PROTECTED]> wrote:
>> I'm on a Twinhead A5000 portable with Linux Mandrake 7.2 installed. The
>> initial kernel (2.2.17) is working not so bad. I mean that it is running,
>> but it only recognize 64 MB on this 128MB system. The sound card is not
>> working either. I once seen the 2.4.0-0.31 kernel working on it, making
>> EVERYTHING to work (memory, video, sound, ethernet, etc... But a malicious
>> user (me) just distroyed the setup completely.


> I have tried to compile the 2.4.0 coming with Mandrake, it is crap and does
> not compile. Just download the standard linux 2.4.0 put the .config which
> comes with Mandrake (saves time) and compile. Works perfectly. I am fed up
> with these packagers like Mandrake and RedHat. They patch all what they see
> and screw everything. Even lpr does not work on my Mandrake 7.2 machine.


> -- 
> Michel Talon

Try slackware. Patrick & co. seem to distribute unpatched packages.
Sometimes the setup (file locations etc) is a little strange, though.

Only had to upgrade modutils to use 2.4.0


        Jerry

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

From: Johnny Choque <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Re: Help to get microseconds cputime precision
Date: Fri, 26 Jan 2001 22:43:05 +0100

Happosai wrote:

> Thank you very much for all your help!
>
> I can't use gettimeofday because i need the cpu time and i have problems
> with the scheduler latencies, as Dave Blake said.
>
> But I will look for information about readtsc.
> Thanks again.
>
> Best regards.

What is "readtsc"?

Johnny


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

Date: Fri, 26 Jan 2001 16:14:00 -0600
From: Robert Redelmeier <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Re: Help to get microseconds cputime precision

Johnny Choque wrote:
> 
> What is "readtsc"?

A typo of `rdtsc`, read Time Stamp Counter.  It's an 
ix86 instruction available on Pentium+ CPUs.  hex 0f 31 

When the CPU executes this instruction, it reads it's 
internal 64bit cycle counter, stuffs the low 32 bits 
in EAX and the high 32 bits in EDX.  The cycle counter
(TSC) increments one for each internal CPU clock tick.
The TSC starts at zero on reset, but can be written.

`c` macros are available to `rdtsc`.

-- Robert  "You have to play the hand you are dealt in Silicon."

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

Date: Fri, 26 Jan 2001 17:05:01 -0700
From: Warren Young <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.networking
Subject: Re: Having trouble compiling tulip.c in RedHat 7

jtnews wrote:
> 
> tulip.o(.text+0x72): undefined reference to `printk_R1b7d4074'

This happens when you've got module versioning turned on in the kernel. 
Turn it off, rebuild the kernel, and then your tulip.o will work
properly.  Or, figure out how to build tulip.c with module versioning.
-- 
= Warren -- ICBM Address: 36.8274040 N, 108.0204086 W, alt. 1714m

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

Date: Fri, 26 Jan 2001 17:06:04 -0700
From: Warren Young <[EMAIL PROTECTED]>
Subject: Re: Only 64Mb???

Anders Larsen wrote:
> 
> Buggy BIOS.

Agreed.  We have a SuperMicro board here with the same problem, only
with 128 MB of RAM.
-- 
= Warren -- ICBM Address: 36.8274040 N, 108.0204086 W, alt. 1714m

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

From: "Ken Wilson" <[EMAIL PROTECTED]>
Subject: Re: cfdisk
Date: Fri, 26 Jan 2001 16:47:12 -0800

Thanks for all replies.



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

Date: Fri, 26 Jan 2001 19:58:29 -0500
From: jtnews <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.networking
Subject: Re: Having trouble compiling tulip.c in RedHat 7

Ok, I will look into this.
Thanks!

Warren Young wrote:
> 
> jtnews wrote:
> >
> > tulip.o(.text+0x72): undefined reference to `printk_R1b7d4074'
> 
> This happens when you've got module versioning turned on in the kernel.
> Turn it off, rebuild the kernel, and then your tulip.o will work
> properly.  Or, figure out how to build tulip.c with module versioning.
> --
> = Warren -- ICBM Address: 36.8274040 N, 108.0204086 W, alt. 1714m

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

From: [EMAIL PROTECTED]
Subject: How to build a USB rescue floppy disk
Date: Sat, 27 Jan 2001 01:07:27 GMT

Hello,

Has anybody able to build a usb rescue floppy disk yet.

I have a bios support that support booting from usb floppy (ie, it can
boot DOS). I have a linux rescue floppy (that boot off regular floppy).
But when I put the rescue floppy into the USB, the system fail to boot.
Just wondering, if there are any special step that I need to do to
build
a usb floppy?

Here is the error message that I got:
Loading ....
Uncompressing Linux
ran out of input data
-- System halt

I know kernel 2.4 support usb but when I look into the code I could not
find anything specific to USB floppy.

Any help would be appreciated.

Thanks


Sent via Deja.com
http://www.deja.com/

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

From: [EMAIL PROTECTED]
Subject: Re: How to build a USB rescue floppy disk
Date: Sat, 27 Jan 2001 05:08:15 -0000

On Sat, 27 Jan 2001 01:07:27 GMT [EMAIL PROTECTED] wrote:

| Has anybody able to build a usb rescue floppy disk yet.
|
| I have a bios support that support booting from usb floppy (ie, it can
| boot DOS). I have a linux rescue floppy (that boot off regular floppy).
| But when I put the rescue floppy into the USB, the system fail to boot.
| Just wondering, if there are any special step that I need to do to
| build
| a usb floppy?
|
| Here is the error message that I got:
| Loading ....
| Uncompressing Linux
| ran out of input data
| -- System halt

Try building the floppy image with syslinux.  Syslinux will load
the kernel and initrd while still in x86 real mode and getting
BIOS support to read the floppy.

You can get syslinux from ftp.XX.kernel.org where XX is your
country code to find the nearest mirror.  It's under utils.
You may have to search for that since each mirror varies
slightly in where things start.


| I know kernel 2.4 support usb but when I look into the code I could not
| find anything specific to USB floppy.

As long as the BIOS supports I/O to the floppy device just the same
for a USB floppy, then it should work just fine for syslinux, which
reads everything before jumping into the kernel.  Lilo does this, too,
so that's another option.

Once booted from the floppy, getting the kernel to read or write a
floppy will still be an issue.

-- 
=================================================================
| Phil Howard - KA9WGN |   Dallas   | http://linuxhomepage.com/ |
| [EMAIL PROTECTED] | Texas, USA | http://phil.ipal.org/     |
=================================================================

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

From: [EMAIL PROTECTED]
Subject: Re: A Linux disaster!
Date: Sat, 27 Jan 2001 05:11:52 -0000

On Fri, 26 Jan 2001 18:03:05 GMT Kaz Kylheku <[EMAIL PROTECTED]> wrote:

| On Sat, 27 Jan 2001 00:57:38 +0800, [EMAIL PROTECTED]
| <[EMAIL PROTECTED]> wrote:
|>Hi, all!
|>
|>I've a disaster on linux! The super-block of one of  my linux partitions
|>was found to be corrupted and don't know how to recover it! The partiion
|>here is /dev/hda6. I tried to install another linux partition on
|>/dev/hda7 and wanted to use e2fsck to fix that partition (e2fsck
|>/dev/hda6 or e2fsck  -b (8193...16385...24577) /dev/hda6) but failed to
|>do this.
|
| It could simply be that your disk drive electronics are toast, which
| would explain why you can't access any of the superblocks. Having
| redundant superblocks only helps when there is some problem with the
| disk surface.

It could also be a fouled up extended partition.  If things get off by
even 1 sector, everything about partition 4 could be toast (although
recoverable if you are very careful and know the original sectors).
I'm worried about what he really did by "tried to install another
linux partition on /dev/hda7".

-- 
=================================================================
| Phil Howard - KA9WGN |   Dallas   | http://linuxhomepage.com/ |
| [EMAIL PROTECTED] | Texas, USA | http://phil.ipal.org/     |
=================================================================

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

From: Nate Eldredge <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.apps
Subject: Re: Help to get microseconds cputime precision
Date: 26 Jan 2001 21:35:15 -0800

Johnny Choque <[EMAIL PROTECTED]> writes:

> Happosai wrote:
> 
> > Thank you very much for all your help!
> >
> > I can't use gettimeofday because i need the cpu time and i have problems
> > with the scheduler latencies, as Dave Blake said.
> >
> > But I will look for information about readtsc.
> > Thanks again.
> >
> > Best regards.
> 
> What is "readtsc"?

An instruction (actually spelled "rdtsc") on Pentium-class CPUs that
returns the contents of a Time Stamp Counter, which increments every
clock cycle.

-- 

Nate Eldredge
[EMAIL PROTECTED]

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

From: Marty <[EMAIL PROTECTED]>
Subject: SEND DIAGNOSTIC and RECEIVE DIAGNOSTIC RESULT
Date: Sat, 27 Jan 2001 17:08:02 +0800
Reply-To: [EMAIL PROTECTED]

I know that the two SCSI command : SEND DIAGNOSTIC and
RECEIVE DIAGNOSTIC RESULT can be used for some advanced features. I know
how to send the command but I don't know how to pass the diagnostic
parameters.

A SEND DIAGNOSTIC command has a PF bit and a parameter list length field
to specify the page format and the length in bytes of the parameter
list. But how to pass the parameter/page ?
where is the parameter list? I am now trying to use the
TRANSLATE ADDRESS PAGE , would anyone explain to me how to use it or
give me a simple example for that ?

Marty.


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

From: [EMAIL PROTECTED] (Ylt007)
Date: 27 Jan 2001 09:26:51 GMT
Subject: CDROM driver

hello everybody
I'm using Mandrake 7.1, and I can't work with my CDROM.
it is recognized by the kernel during sarting 
Here is a bit of startingmessage's log :
....
PIIX4: IDE controller on PCI bus 00 dev f9
PIIX4: not 100% native mode: will probe irqs later
    ide0: BM-DMA at 0xffa0-0xffa7, BIOS settings: hda:DMA, hdb:pio
            ide1: BM-DMA at 0xffa8-0xffaf, BIOS settings: hdc:DMA, hdd:pio
                hda: IBM-DPTA-371360, ATA DISK drive
                hdc: CD-RW CRX100E, ATAPI CDROM drive
                hdd: IOMEGA ZIP 100 ATAPI, ATAPI FLOPPY drive
                ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
                ide1 at 0x170-0x177,0x376 on irq 15
                hda: IBM-DPTA-371360, 13042MB w/1961kB Cache, CHS=1662/255/63
                Floppy drive(s): fd0 is 1.44M
....

When I try to mount the CDROM, bash answers:

/dev/hdc isn't a bloc device, no pilot on /dev/hdc

When I read  fstab it appear that /dev/hdc has a major number 22 and minor 0
which is right.
But I don't know whereis IDECD which would be the driver.
Does anyone would have suggestion
Yves LE TILLY.

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

From: Carfield Yim <[EMAIL PROTECTED]>
Subject: Linux Kernel book about linux 2.0 still useful??
Date: Sat, 27 Jan 2001 09:23:00 GMT

I have borrow a book of linux kernel call "Linux Kernel Internals"
http://www.amazon.com/exec/obidos/ASIN/0201331438/qid=980587111/sr=2-
3/ref=sc_b_3/105-4344940-5085540

After scanning through the book, I find that it is a good written book.
However, the kernel this book discussing is still 2.0, do I still worth
to put time to read it?


Sent via Deja.com
http://www.deja.com/

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

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: how can i modify kernel memory at runtime
Date: Sat, 27 Jan 2001 11:33:31 +0100

Eric Taylor wrote:
> 
> Hi:
> 
> I want to try to modify an instruction in
> kernel memory. Is there a utility around that
> can do this easily.
> 
> All I need to do is deposit a single 32bit
> value at a particular kernel location. I've
> determined the location I want to change
> by using gdb:
> 
> gdb /usr/src/linux/vmlinux /proc/kcore
> (gdb) x/x get_unmapped_area+15+8
> 0x8011bef3 <get_unmapped_area+23>:      0x40000000
> 
> I want to be able to change this value without
> the need to rebuild the kernel. (I believe this
> value will change where in memory libraries get
> loaded)
> 
> I'm not worried about syncing with the kernel, but
> if such a utility would handle that too, all the
> better.
> 
> thanks
> eric

You could write something like:

#include <linux/module.h>
int init_module()
{
   int *p =(int*)0x8011bef3;
   if (*p==0x40000000) *p=0x20000000;
   return 1;
}

compile it as a module and insmod it.
The consistency check is just an
example, instead you could verify the
ints before and after, and perhaps
pass the new value as an argument to
the module.

Btw. I can see that your kernel is
compiled for 2GB physical memory, if
you are short in virtual address space
perhaps you should consider using a
3/1GB split. If you actually have more
than one GB you could also consider a
newer kernel with the BIGMEM option.

-- 
Kasper Dupont

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

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: Accessing Kernel Process Structs from a Module
Date: Sat, 27 Jan 2001 11:39:56 +0100

Andi Kleen wrote:
> 
> Bob Dilworth <[EMAIL PROTECTED]> writes:
> >
> > xtime is one of the exported symbols available to modules and I can see
> > it (the symbol) in /proc/ksyms.  So far so good.  What I'd like to do
> > next is walk down the process list and perhaps display the name of a
> > file that a process on the list has open.  I can see how to reach the
> > d_name field in the dentry object from the process descriptor structure
> > but I can't figure out how to find the head of the process list to start
> > grabbing the process descriptors for the processes on the list.
> > /proc/ksyms doesn't seem to have a symbol corresponding to the head of
> > the process list - at least I can't seem to find such a symbol. Does
> > this mean that the pointer to the head of the process list is
> > unavailable from a kernel module?  So ... how does one obtain the head
> > of the process list from a kernel module?
> 
> init_task_union.task contains init which is a member of the task ring
> (it's a ring,not a list). You can then walk it via ->next_task in 2.2 until
> you reach init_task again. The for_each_task() macro will also do that for
> you.
> 
> -Andi

I tried that once, but found that it
didn't work because the macro used a
symbol which was not exported. But
starting with current instead did
work. If you want to know which one
is the init_task, you can probably
use the pid.

-- 
Kasper Dupont

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

From: root <[EMAIL PROTECTED]>
Subject: Re: getche()
Date: Sat, 27 Jan 2001 11:30:35 +0000

I just wanted a funtion that could get input without need to press enter. I don't
need to change the echo.
How can i change the terminal setup from c/c++. Writting to some files?
BTW what are terminal modes. I am really a newbie. Please use basic words.

Thanks for your help.

George Houpis wrote:

> Try getchar().  If you need it without blocking or without echoing, then you
> have more work to do, i.e. you need to setup terminal modes.
>
> getchar() need #include <stdio.h>, Linux does not use conio.h, that is unique
> to DOS...
>
> Welcome to the better programming environment.
>
> George
>
> Filipe Maia wrote:
>
> > Is there a equivelant linux function for the windows getche from conio.h?
> > I am newbie in programming and i am having some difficulties in porting code
> > from win to linux.
> > Can someone help me?


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

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: Why does my e2fs always fsck bad?
Date: Sat, 27 Jan 2001 12:49:19 +0100

[EMAIL PROTECTED] wrote:
> 
> Hi, I have a server (BTW: RH 62 w/ latest patches) which is up quite
> constantly, but I do manually reboot it for various reasons every 2-3-4
> weeks or so.  When I reboot it, I do a
> 
>         shutdown -t10 -rF now
> 
> In order to force a fsck upon reboot.  Then I check the /var/log/messages,
> and I almost always see error messages of the type:
> 
> fsck: /dev/hda1: Setting filetype for entry '31665'
>                                         in /tmp/.ICE-unix (16216) to 6.
> 
> Now, I see perhaps 10 of these messages for files various 'entries' in
> /tmp/.ICE-unix and also a dozen or so for various filetypes 'orb***' in
> /tmp/orbit-user.  Also some of my dhcp state files get the same treatment.
> 
> Now I know that the fs is getting unmounted, etc, because upon reboot the
> dirty flag is not set (if I do not specify the -F to shutdown, there is no
> fsck).
> 
> Does anybody know what gives?
> 
> Thanks,
> John T.

The new version of e2fsck has the strange idea, that this
field on all sockets should be changed from 0 to 6.

The ext2 filesystem in the kernel creates sockets with
this field set to 0, but does not seem to care if they
have been changed to 6.

This happens with RedHat 6.2 and 7.0 (e2fsprogs-1.18-15),
it dit not happen with RedHat 6.0 (e2fsprogs-1.14-4). I
don't know about other distributions.

Except from theese anoying messages from e2fsck it does
not seem to be any problem.

-- 
Kasper Dupont

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

From: Kasper Dupont <[EMAIL PROTECTED]>
Subject: Re: Debugging "outb" and "inb"
Date: Sat, 27 Jan 2001 12:56:19 +0100

Tim Roberts wrote:
> 
> [EMAIL PROTECTED] wrote:
> >
> >I'm writing an user-process that uses sentences like "outb" and "inb",
> >how can I debug it? I've tried with gdb, but it can't execute the code
> >"step by step" when it reaches the outb and inb sentences.
> 
> What happens when you do this?  I've debugged the X server many times and
> stepped through in/out instructions.
> 
> You are running as root, right?  Port I/O is only allowed from root.  I
> don't believe setuid survives gdb, so you will have to be logged on AS
> root.
> --
> - Tim Roberts, [EMAIL PROTECTED]
>   Providenza & Boekelheide, Inc.

For security reasons ordinary users cannot be
allowed to know what goes on inside setuid
binaries. Even if the user has read permisions
to the executable the program could be
processing some data which the user does not
have read permitions for.

I don't know what gdb will do, either run it
without suid or refuse to run it at all.

-- 
Kasper Dupont

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


** 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 the
comp.os.linux.development.system newsgroup.

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-Development-System Digest
******************************

Reply via email to