From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,e133a5fe5573d8c6,start X-Google-Attributes: gidfee84,public From: haymanr@icefog.alaska.edu (Randy M. Hayman) Subject: how to read from KSEG Date: 1995/11/20 Message-ID: <48qkhi$gps@news.alaska.edu>#1/1 X-Deja-AN: 120018194 distribution: world organization: University of Alaska reply-to: haymanr@icefog.alaska.edu newsgroups: comp.unix.osf.osf1 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