From: haymanr@icefog.alaska.edu (Randy M. Hayman)
Subject: how to read from KSEG
Date: 1995/11/20 [thread overview]
Message-ID: <48qkhi$gps@news.alaska.edu> (raw)
Greetings -
Does anybody have an example of C code to read from KSEG space?
(call_pal callsys, goto kernel mode, read or lseek, fprintf, retsys)?
I keep bumping into errno 14 (Bad address) for obvious reasons trying to
read(io,ei.ah.text_start,ei.ah.tsize) from various kernels on my system.
I'm attempting to debug or pinpoint short reads we see occasionally loading
kernels during boot.
snippet of code:
lseek(io, N_TXTOFF(ei.fh, ei.ah), 0);
printf ("Sizes:\ntext = 0x%lx (%u)\n", ei.ah.tsize, ei.ah.tsize);
bytes_read = read(io, ei.ah.text_start, ei.ah.tsize);
if (errno)
printf("\tread(io,ei.ah.text_start,ei.ah.tsize) - errno: %d (%s)\n", errno, strerror(errno));
printf("\t0x%lx (%d) bytes read, \n\ttried to read 0x%lx (%u) bytes; \n\tstarting at 0x%lx (%u))\n\n",
bytes_read, bytes_read, ei.ah.tsize, ei.ah.tsize, ei.ah.text_start, ei.ah.text_start);
output related to above code:
Sizes:
text = 0x2bd100 (2871552)
read(io,ei.ah.text_start,ei.ah.tsize) - errno: 14 (Bad address)
0xffffffffffffffff (-1) bytes read,
tried to read 0x2bd100 (2871552) bytes;
starting at 0xfffffc0000230000)
Thank you very much.
--
Randy M. Hayman haymanr@icefog.alaska.edu
"Ethernet works in practice but not in theory" -- Bob Metcalfe
reply other threads:[~1995-11-20 5:00 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox