Article View: comp.unix.bsd
Article #6115Problem with the low level I/O.
From: H. Murakami
Date: Mon, 01 Feb 1993 14:38
Date: Mon, 01 Feb 1993 14:38
112 lines
3376 bytes
3376 bytes
I found, that the 386bsd0.1
The I/O function read()
cannot work with the large buffer size
for the raw device.
Instead it just returns the size it actually read,
The console message appeares saying that
"Out of range, cannot happen? Device not configured"
I have Sony workstation, it can read or write
to the disks or tapes with very large buffer
size I/O operation.
For example,
% tar cvfb /dev/rmt0 10000
I wonder, if this ("Device not configured" etc.)
is a bug or specification of POSIX.
Script started on Sun Jan 24 13:05:16 1993
%
% gcc -DNSECT=100 b.c
% a.out
Success.
%
% gcc -DNSECT=110 b.c
% a.out
Success.
%
% gcc -DNSECT=120 b.c
% a.out
Success.
%
% gcc -DNSECT=125 b.c
% a.out
Success.
%
% gcc -DNSECT=126 b.c
% a.out
Out of range, cannot happen? Device not configured
%
% gcc -DNSECT=127 b.c
% a.out
Out of range, cannot happen? Device not configured
%
% gcc -DNSECT=130 b.c
% a.out
Out of range, cannot happen? Device not configured
%
% cat b.c
/* Start of sample program. */
#define DEVICE "/dev/ras0c" /* SCSI Raw device to be tested. */
#include <stdio.h>
#include <sys/file.h>
#include <sys/types.h>
#include <sys/times.h>
#define MAXSECT 500
#define NB (512*MAXSECT)
static char buf[NB];
main()
{
int d;
int rtn;
int size;
if ((d=open(DEVICE, O_RDONLY, 0444))<=0) {
fprintf(stderr, "Device open error.\n");
exit(1); }
size = 512 * NSECT;
if (size > NB) {
fprintf(stderr, "NSECT too large. size > NB.\n");
exit(2); }
rtn = read(d, buf, size);
if(rtn <=0) {
extern int errno;
perror("");
exit(3);
}
fprintf(stderr, "Success.\n");
close(d);
}
/* THE END. */
% exit
% exit
Script done on Sun Jan 24 13:06:21 1993
PS.
If I changed the #define DEVICE to the raw IDE drive like /dev/rwd0a,
the limit of NSECT with success goes up was observed, however,
if it is raised somevalue between 200 and 300, the system hangs up anyway.
Wmmm.... this trouble may be related to the hang up
when mallocing by many processes.
Does this bug relates to the limitation of the kernel must reside
below a mega bytes?
Hiroshi Murakami
mhiroshi@tansei.cc.u-tokyo.ac.jp
hiroshi@teine.chem2.hokudai.ac.jp
Technical Details
Message-ID:
<4025@tansei1.tansei.cc.u-tokyo.ac.jp>Path:
arc1-ca.pugleaf.net!sparky!uunet!ferkel.ucsb.edu!taco!rock!concert!gatech!paladin.american.edu!howland.reston.ans.net!zaphod.mps.ohio-state.edu!cs.utexas.edu!sun-barr!sh.wide!wnoc-tyo-news!news.u-tokyo.ac.jp!yayoi!tansei1!mhiroshiShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10ad36,83b55d4549d8a0a0,start X-Google-Attributes: gid10ad36,public X-Google-Thread: 14fed8,83b55d4549d8a0a0,start X-Google-Attributes: gid14fed8,public X-Google-ArrivalTime: 1993-02-01 06:38:10 PST Path: arc1-ca.pugleaf.net!sparky!uunet!ferkel.ucsb.edu!taco!rock!concert!gatech!paladin.american.edu!howland.reston.ans.net!zaphod.mps.ohio-state.edu!cs.utexas.edu!sun-barr!sh.wide!wnoc-tyo-news!news.u-tokyo.ac.jp!yayoi!tansei1!mhiroshi From: mhiroshi@tansei.cc.u-tokyo.ac.jp (H. Murakami) Newsgroups: comp.unix.bsd,fj.os.386bsd Subject: Problem with the low level I/O. Message-ID: <4025@tansei1.tansei.cc.u-tokyo.ac.jp> Date: 1 Feb 93 14:38:10 GMT Sender: news@tansei.cc.u-tokyo.ac.jp Followup-To: comp.unix.bsd Organization: Hokkaido Univ. However I am subject to tansei for JUNET. Lines: 113