* how to read from KSEG
@ 1995-11-20 5:00 Randy M. Hayman
0 siblings, 0 replies; only message in thread
From: Randy M. Hayman @ 1995-11-20 5:00 UTC (permalink / 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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1995-11-20 5:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1995-11-20 5:00 how to read from KSEG Randy M. Hayman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox