diff -u --recursive v1.1.29/linux/Makefile linux/Makefile --- v1.1.29/linux/Makefile Sat Jul 16 19:51:20 1994 +++ linux/Makefile Thu Jul 14 20:17:49 1994 @@ -1,6 +1,6 @@ VERSION = 1 PATCHLEVEL = 1 -SUBLEVEL = 29 +SUBLEVEL = 30 all: Version zImage diff -u --recursive v1.1.29/linux/boot/bootsect.S linux/boot/bootsect.S --- v1.1.29/linux/boot/bootsect.S Wed Dec 1 14:44:15 1993 +++ linux/boot/bootsect.S Thu Jul 14 20:17:22 1994 @@ -25,7 +25,7 @@ ! buffer cache as in minix (and especially now that the kernel is ! compressed :-) ! -! The loader has been made as simple as possible, and continuos +! The loader has been made as simple as possible, and continuous ! read errors will result in a unbreakable loop. Reboot by hand. It ! loads pretty fast by getting whole tracks at a time whenever possible. @@ -69,7 +69,7 @@ jmpi go,INITSEG go: mov ax,cs - mov dx,#0x4000-12 ! 0x4000 is arbitrary value >= length of + mov di,#0x4000-12 ! 0x4000 is arbitrary value >= length of ! bootsect + length of setup + room for stack ! 12 is disk parm size @@ -82,7 +82,7 @@ mov ds,ax mov es,ax mov ss,ax ! put stack at INITSEG:0x4000-12. - mov sp,dx + mov sp,di /* * Many BIOS's default disk parameter tables will not * recognize multi-sector reads beyond the maximum sector number @@ -92,40 +92,38 @@ * Since single sector reads are slow and out of the question, * we must take care of this by creating new parameter tables * (for the first disk) in RAM. We will set the maximum sector - * count to 18 - the most we will encounter on an HD 1.44. + * count to 36 - the most we will encounter on an ED 2.88. * * High doesn't hurt. Low does. * * Segments are as follows: ds=es=ss=cs - INITSEG, - * fs = 0, gs = parameter table segment + * fs = 0, gs is unused. */ push #0 pop fs mov bx,#0x78 ! fs:bx is parameter table address + push ds seg fs - lgs si,(bx) ! gs:si is source + lds si,(bx) ! ds:si is source - mov di,dx ! es:di is destination mov cx,#6 ! copy 12 bytes cld + push di rep - seg gs movsw - mov di,dx - movb 4(di),*18 ! patch sector count + pop di + pop ds + movb 4(di),*36 ! patch sector count + seg fs mov (bx),di seg fs mov 2(bx),es - mov ax,cs - mov fs,ax - mov gs,ax - xor ah,ah ! reset FDC xor dl,dl int 0x13 @@ -170,26 +168,31 @@ #else ! It seems that there is no BIOS call to get the number of sectors. Guess -! 18 sectors if sector 18 can be read, 15 if sector 15 can be read. -! Otherwise guess 9. +! 36 sectors if sector 36 can be read, 18 sectors if sector 18 can be read, +! 15 if sector 15 can be read. Otherwise guess 9. + + mov si,#disksizes ! table of sizes to try +probe_loop: + lodsb + cbw ! extend to word + seg cs + mov sectors, ax + cmp si,#disksizes+4 + jae got_sectors ! if all else fails, try 9 + xchg ax, cx ! cx = track and sector xor dx, dx ! drive 0, head 0 - mov cx,#0x0012 ! sector 18, track 0 mov bx,#0x0200+SETUPSECS*0x200 ! address after setup (es = cs) mov ax,#0x0201 ! service 2, 1 sector int 0x13 - jnc got_sectors - mov cl,#0x0f ! sector 15 - mov ax,#0x0201 ! service 2, 1 sector - int 0x13 - jnc got_sectors - mov cl,#0x09 + jc probe_loop ! try next value #endif got_sectors: - seg cs - mov sectors,cx + +! Restore es + mov ax,#INITSEG mov es,ax @@ -216,8 +219,8 @@ ! After that we check which root-device to use. If the device is ! defined (!= 0), nothing is done and the given device is used. -! Otherwise, either /dev/PS0 (2,28) or /dev/at0 (2,8), depending -! on the number of sectors that the BIOS reports currently. +! Otherwise, one of /dev/fd0H2880 (2,32) or /dev/PS0 (2,28) or /dev/at0 (2,8), +! depending on the number of sectors we pretend to know we have. seg cs mov ax,root_dev @@ -228,10 +231,13 @@ mov ax,#0x0208 ! /dev/ps0 - 1.2Mb cmp bx,#15 je root_defined - mov ax,#0x021c ! /dev/PS0 - 1.44Mb + mov al,#0x1c ! /dev/PS0 - 1.44Mb cmp bx,#18 je root_defined - mov ax,#0x0200 ! /dev/fd0 - autodetect + mov al,#0x20 ! /dev/fd0H2880 - 2.88Mb + cmp bx,#36 + je root_defined + mov al,#0 ! /dev/fd0 - autodetect root_defined: seg cs mov root_dev,ax @@ -362,7 +368,7 @@ push cx ! save count left call print_nl ! nl for readability - cmp cl, 5 + cmp cl, #5 jae no_reg ! see if register name is needed mov ax, #0xe05 + 'A - 1 @@ -399,15 +405,12 @@ mov dx, (bp) ! load word into dx print_digit: rol dx, #4 ! rotate so that lowest 4 bits are used - mov ah, #0xe - mov al, dl ! mask off so we have only next nibble - and al, #0xf - add al, #'0 ! convert to 0-based digit - cmp al, #'9 ! check for overflow - jbe good_digit - add al, #'A - '0 - 10 - -good_digit: + mov ax, #0xe0f ! ah = request, al = mask for nybble + and al, dl + add al, #0x90 ! convert al to ascii hex (four instructions) + daa + adc al, #0x40 + daa int 0x10 loop print_digit ret @@ -428,6 +431,9 @@ sectors: .word 0 + +disksizes: + .byte 36,18,15,9 msg1: .byte 13,10 diff -u --recursive v1.1.29/linux/boot/head.S linux/boot/head.S --- v1.1.29/linux/boot/head.S Tue Jun 28 22:30:25 1994 +++ linux/boot/head.S Thu Jul 14 20:17:22 1994 @@ -285,8 +285,8 @@ /* * floppy_track_buffer is used to buffer one track of floppy data: it * has to be separate from the tmp_floppy area, as otherwise a single- - * sector read/write can mess it up. It can contain one full track of - * data (18*2*512 bytes). + * sector read/write can mess it up. It can contain one full cylinder (sic) of + * data (36*2*512 bytes). */ _floppy_track_buffer: .fill 512*2*36,1,0 diff -u --recursive v1.1.29/linux/drivers/block/blk.h linux/drivers/block/blk.h --- v1.1.29/linux/drivers/block/blk.h Sat Jul 16 19:51:20 1994 +++ linux/drivers/block/blk.h Sat Jul 16 22:24:36 1994 @@ -21,8 +21,8 @@ /* * Ok, this is an expanded form so that we can use the same * request for paging requests when that is implemented. In - * paging, 'bh' is NULL, and 'waiting' is used to wait for - * read/write completion. + * paging, 'bh' is NULL, and the semaphore is used to wait + * for read/write completion. */ struct request { int dev; /* -1 if no request */ @@ -32,7 +32,7 @@ unsigned long nr_sectors; unsigned long current_nr_sectors; char * buffer; - struct task_struct * waiting; + struct semaphore * sem; struct buffer_head * bh; struct buffer_head * bhtail; struct request * next; @@ -271,7 +271,6 @@ { struct request * req; struct buffer_head * bh; - struct task_struct * p; req = CURRENT; req->errors = 0; @@ -302,13 +301,8 @@ } DEVICE_OFF(req->dev); CURRENT = req->next; - if ((p = req->waiting) != NULL) { - req->waiting = NULL; - p->swapping = 0; - p->state = TASK_RUNNING; - if (p->counter > current->counter) - need_resched = 1; - } + if (req->sem != NULL) + up(req->sem); req->dev = -1; wake_up(&wait_for_request); } diff -u --recursive v1.1.29/linux/drivers/block/floppy.c linux/drivers/block/floppy.c --- v1.1.29/linux/drivers/block/floppy.c Fri Jul 8 13:26:32 1994 +++ linux/drivers/block/floppy.c Thu Jul 14 20:17:22 1994 @@ -68,6 +68,10 @@ * minor modifications to allow 2.88 floppies to be run. */ +/* 1994/7/13 -- Paul Vojta -- modified the probing code to allow three or more + * disk types. + */ + #define REALLY_SLOW_IO #define FLOPPY_IRQ 6 @@ -165,34 +169,68 @@ { 1440, 9,2,80,0,0x23,0x01,0xDF,0x50,NULL }, /* 720kB in 1.2MB drive */ { 2880,18,2,80,0,0x1B,0x00,0xCF,0x6C,NULL }, /* 1.44MB diskette */ { 5760,36,2,80,0,0x1B,0x43,0xAF,0x54,NULL }, /* 2.88MB diskette */ - { 5760,36,2,80,0,0x1B,0x43,0xAF,0x54,NULL }, /* 2.88MB diskette */ }; /* - * Auto-detection. Each drive type has a pair of formats which are + * Auto-detection. Each drive type has a number of formats which are * used in succession to try to read the disk. If the FDC cannot lock onto * the disk, the next format is tried. This uses the variable 'probing'. */ -static struct floppy_struct floppy_types[] = { - { 720, 9,2,40,0,0x2A,0x02,0xDF,0x50,"360k/PC" }, /* 360kB PC diskettes */ +#define NUMBER(x) (sizeof(x) / sizeof(*(x))) + +static struct floppy_struct floppy_type_1[] = { { 720, 9,2,40,0,0x2A,0x02,0xDF,0x50,"360k/PC" }, /* 360kB PC diskettes */ +}; + +static struct floppy_struct floppy_type_2[] = { { 2400,15,2,80,0,0x1B,0x00,0xDF,0x54,"1.2M" }, /* 1.2 MB AT-diskettes */ { 720, 9,2,40,1,0x23,0x01,0xDF,0x50,"360k/AT" }, /* 360kB in 1.2MB drive */ - { 1440, 9,2,80,0,0x2A,0x02,0xDF,0x50,"720k" }, /* 3.5" 720kB diskette */ +}; + +static struct floppy_struct floppy_type_3[] = { { 1440, 9,2,80,0,0x2A,0x02,0xDF,0x50,"720k" }, /* 3.5" 720kB diskette */ +}; + +static struct floppy_struct floppy_type_4[] = { + { 2880,18,2,80,0,0x1B,0x00,0xCF,0x6C,"1.44M" }, /* 1.44MB diskette */ + { 1440, 9,2,80,0,0x2A,0x02,0xDF,0x50,"720k/AT" }, /* 3.5" 720kB diskette */ +}; + +static struct floppy_struct floppy_type_5[] = { + { 5760,36,2,80,0,0x1B,0x43,0xAF,0x50,"2.88M" }, /* 2.88MB diskette */ { 2880,18,2,80,0,0x1B,0x00,0xCF,0x6C,"1.44M" }, /* 1.44MB diskette */ { 1440, 9,2,80,0,0x2A,0x02,0xDF,0x50,"720k/AT" }, /* 3.5" 720kB diskette */ - { 5760,36,2,80,0,0x1B,0x43,0xAF,0x54,"2.88M-AMI" }, /* DUMMY */ - { 2880,18,2,80,0,0x1B,0x00,0xCF,0x6C,"1.44M-AMI" }, /* Dummy */ - { 5760,36,2,80,0,0x1B,0x43,0xAF,0x54,"2.88M" }, /* 2.88MB diskette */ - { 2880,18,2,80,0,0x1B,0x40,0xCF,0x6C,"1.44MX" }, /* 1.44MB diskette */ +}; + +#define floppy_type_6 floppy_type_5 /* 5 and 6 are the same */ + + +static struct floppy_struct *floppy_types[] = { + floppy_type_1, + floppy_type_2, + floppy_type_3, + floppy_type_4, + floppy_type_5, + floppy_type_6, +}; + +static int floppy_num_types[] = { + NUMBER(floppy_type_1), + NUMBER(floppy_type_2), + NUMBER(floppy_type_3), + NUMBER(floppy_type_4), + NUMBER(floppy_type_5), + NUMBER(floppy_type_6), }; /* Auto-detection: Disk type used until the next media change occurs. */ struct floppy_struct *current_type[4] = { NULL, NULL, NULL, NULL }; /* This type is tried first. */ -struct floppy_struct *base_type[4]; +struct floppy_struct *base_type[4] = { NULL, NULL, NULL, NULL }; + +/* This gives the end of the list */ +struct floppy_struct *base_type_end[4]; /* * User-provided type information. current_type points to @@ -279,8 +317,8 @@ * Track buffer and block buffer (in case track buffering doesn't work). * Because these are written to by the DMA controller, they must * not contain a 64k byte boundary crossing, or data will be - * corrupted/lost. Alignment of these is enforced in boot/head.s. - * Note that you must not change the sizes below without updating head.s. + * corrupted/lost. Alignment of these is enforced in boot/head.S. + * Note that you must not change the sizes below without updating head.S. */ extern char tmp_floppy_area[BLOCK_SIZE]; extern char floppy_track_buffer[512*2*MAX_BUFFER_SECTORS]; @@ -395,6 +433,7 @@ void request_done(int uptodate) { timer_active &= ~(1 << FLOPPY_TIMER); + probing = 0; if (format_status != FORMAT_BUSY) end_request(uptodate); else { @@ -563,6 +602,13 @@ { int errors; + if (probing) { + int device = MINOR(CURRENT_DEVICE) & 3; + ++floppy; + if (floppy < base_type_end[device]) + return; + floppy = base_type[device]; + } current_track = NO_TRACK; if (format_status == FORMAT_BUSY) errors = ++format_errors; @@ -1080,21 +1126,20 @@ } } seek = 0; - probing = 0; device = MINOR(CURRENT_DEVICE); if (device > 3) floppy = (device >> 2) + floppy_type; else { /* Auto-detection */ - floppy = current_type[device & 3]; - if (!floppy) { - probing = 1; - floppy = base_type[device & 3]; + if (!probing) { + floppy = current_type[device & 3]; if (!floppy) { - request_done(0); - goto repeat; + probing = 1; + floppy = base_type[device & 3]; + if (!floppy) { + request_done(0); + goto repeat; + } } - if (CURRENT_ERRORS & 1) - floppy++; } } if (format_status != FORMAT_BUSY) { @@ -1297,33 +1342,29 @@ inb_p(0x71); \ }) -static struct floppy_struct *find_base(int drive,int code) +static void set_base_type(int drive,int code) { struct floppy_struct *base; - if (code > 0 && code < 7) { /* -bb*/ - base = &floppy_types[(code-1)*2]; + if (code > 0 && code <= NUMBER(floppy_types)) { + base = floppy_types[code-1]; printk("fd%d is %s",drive,base->name); - return base; - } else if (!code) { + base_type[drive] = base; + base_type_end[drive] = base + floppy_num_types[code-1]; + } else if (!code) printk("fd%d is not installed", drive); - return NULL; - } - printk("fd%d is unknown type %d",drive,code); - return NULL; + else + printk("fd%d is unknown type %d",drive,code); } static void config_types(void) { printk("Floppy drive(s): "); - base_type[0] = find_base(0,(CMOS_READ(0x10) >> 4) & 15); - if ((CMOS_READ(0x10) & 15) == 0) - base_type[1] = NULL; - else { + set_base_type(0, (CMOS_READ(0x10) >> 4) & 15); + if (CMOS_READ(0x10) & 15) { printk(", "); - base_type[1] = find_base(1,CMOS_READ(0x10) & 15); + set_base_type(1, CMOS_READ(0x10) & 15); } - base_type[2] = base_type[3] = NULL; printk("\n"); } diff -u --recursive v1.1.29/linux/drivers/block/ll_rw_blk.c linux/drivers/block/ll_rw_blk.c --- v1.1.29/linux/drivers/block/ll_rw_blk.c Sat Jul 16 19:51:20 1994 +++ linux/drivers/block/ll_rw_blk.c Sat Jul 16 22:24:36 1994 @@ -233,7 +233,7 @@ req = req->next; while (req) { if (req->dev == bh->b_dev && - !req->waiting && + !req->sem && req->cmd == rw && req->sector + req->nr_sectors == sector && req->nr_sectors < 244) @@ -247,7 +247,7 @@ } if (req->dev == bh->b_dev && - !req->waiting && + !req->sem && req->cmd == rw && req->sector - count == sector && req->nr_sectors < 244) @@ -292,7 +292,7 @@ req->nr_sectors = count; req->current_nr_sectors = count; req->buffer = bh->b_data; - req->waiting = NULL; + req->sem = NULL; req->bh = bh; req->bhtail = bh; req->next = NULL; @@ -303,6 +303,7 @@ { struct request * req; unsigned int major = MAJOR(dev); + struct semaphore sem = MUTEX_LOCKED; if (major >= MAX_BLKDEV || !(blk_dev[major].request_fn)) { printk("Trying to read nonexistent block-device %04x (%d)\n",dev,page*8); @@ -324,16 +325,11 @@ req->nr_sectors = 8; req->current_nr_sectors = 8; req->buffer = buffer; - req->waiting = current; + req->sem = &sem; req->bh = NULL; req->next = NULL; - current->swapping = 1; - current->state = TASK_SWAPPING; add_request(major+blk_dev,req); - /* The I/O may have inadvertently chagned the task state. - Make sure we really wait until the I/O is done */ - if (current->swapping) current->state = TASK_SWAPPING; - schedule(); + down(&sem); } /* This function can be used to request a number of buffers from a block @@ -435,6 +431,7 @@ int buffersize; struct request * req; unsigned int major = MAJOR(dev); + struct semaphore sem = MUTEX_LOCKED; if (major >= MAX_BLKDEV || !(blk_dev[major].request_fn)) { printk("ll_rw_swap_file: trying to swap nonexistent block-device\n"); @@ -463,16 +460,11 @@ req->nr_sectors = buffersize >> 9; req->current_nr_sectors = buffersize >> 9; req->buffer = buf; - req->waiting = current; + req->sem = &sem; req->bh = NULL; req->next = NULL; - current->swapping = 1; - current->state = TASK_UNINTERRUPTIBLE; add_request(major+blk_dev,req); - /* The I/O may have inadvertently chagned the task state. - Make sure we really wait until the I/O is done */ - if (current->swapping) current->state = TASK_UNINTERRUPTIBLE; - schedule(); + down(&sem); } } diff -u --recursive v1.1.29/linux/drivers/net/Makefile linux/drivers/net/Makefile --- v1.1.29/linux/drivers/net/Makefile Fri Jul 8 13:26:33 1994 +++ linux/drivers/net/Makefile Thu Jul 14 20:23:58 1994 @@ -8,7 +8,7 @@ include CONFIG include MODULES -NETDRV_OBJS := net.a(Space.o) net.a(auto_irq.o) net.a(net_init.o) net.a(loopback.o) +NETDRV_OBJS := Space.o auto_irq.o net_init.o loopback.o CFLAGS := $(CFLAGS) -I../../net/inet CPP := $(CPP) -I../../net/inet @@ -25,28 +25,28 @@ endif ifdef CONFIG_WD80x3 -NETDRV_OBJS := $(NETDRV_OBJS) net.a(wd.o) +NETDRV_OBJS := $(NETDRV_OBJS) wd.o CONFIG_8390 = CONFIG_8390 wd.o: wd.c CONFIG $(CC) $(CPPFLAGS) $(CFLAGS) $(WD_OPTS) -c $< endif ifdef CONFIG_EL2 -NETDRV_OBJS := $(NETDRV_OBJS) net.a(3c503.o) +NETDRV_OBJS := $(NETDRV_OBJS) 3c503.o CONFIG_8390 = CONFIG_8390 3c503.o: 3c503.c CONFIG $(CC) $(CPPFLAGS) $(CFLAGS) $(EL2_OPTS) -c $< endif ifdef CONFIG_NE2000 -NETDRV_OBJS := $(NETDRV_OBJS) net.a(ne.o) +NETDRV_OBJS := $(NETDRV_OBJS) ne.o CONFIG_8390 = CONFIG_8390 ne.o: ne.c CONFIG $(CC) $(CPPFLAGS) $(CFLAGS) $(NE_OPTS) -c $< endif ifdef CONFIG_HPLAN -NETDRV_OBJS := $(NETDRV_OBJS) net.a(hp.o) +NETDRV_OBJS := $(NETDRV_OBJS) hp.o CONFIG_8390 = CONFIG_8390 hp.o: hp.c CONFIG $(CC) $(CPPFLAGS) $(CFLAGS) $(HP_OPTS) -c $< @@ -58,47 +58,47 @@ endif ifdef CONFIG_ULTRA -NETDRV_OBJS := $(NETDRV_OBJS) net.a(smc-ultra.o) +NETDRV_OBJS := $(NETDRV_OBJS) smc-ultra.o CONFIG_8390 = CONFIG_8390 endif ifdef CONFIG_E2100 -NETDRV_OBJS := $(NETDRV_OBJS) net.a(e2100.o) +NETDRV_OBJS := $(NETDRV_OBJS) e2100.o CONFIG_8390 = CONFIG_8390 endif ifdef CONFIG_PLIP -NETDRV_OBJS := $(NETDRV_OBJS) net.a(plip.o) +NETDRV_OBJS := $(NETDRV_OBJS) plip.o plip.o: plip.c CONFIG $(CC) $(CPPFLAGS) $(CFLAGS) $(PLIP_OPTS) -c $< endif ifdef CONFIG_PPP -NETDRV_OBJS := $(NETDRV_OBJS) net.a(ppp.o) net.a(slhc.o) +NETDRV_OBJS := $(NETDRV_OBJS) ppp.o slhc.o endif ifdef CONFIG_SLIP -NETDRV_OBJS := $(NETDRV_OBJS) net.a(slip.o) net.a(slhc.o) +NETDRV_OBJS := $(NETDRV_OBJS) slip.o slhc.o slip.o: slip.c CONFIG $(CC) $(CPPFLAGS) $(CFLAGS) -c $< endif ifdef CONFIG_DE650 -NETDRV_OBJS := $(NETDRV_OBJS) net.a(de650.o) +NETDRV_OBJS := $(NETDRV_OBJS) de650.o CONFIG_8390 = CONFIG_8390 endif ifdef CONFIG_3C589 -NETDRV_OBJS := $(NETDRV_OBJS) net.a(3c589.o) +NETDRV_OBJS := $(NETDRV_OBJS) 3c589.o endif ifdef CONFIG_DUMMY -NETDRV_OBJS := $(NETDRV_OBJS) net.a(dummy.o) +NETDRV_OBJS := $(NETDRV_OBJS) dummy.o dummy.o: dummy.c CONFIG $(CC) $(CPPFLAGS) $(CFLAGS) -c $< endif ifdef CONFIG_DE600 -NETDRV_OBJS := $(NETDRV_OBJS) net.a(de600.o) +NETDRV_OBJS := $(NETDRV_OBJS) de600.o endif de600.o: de600.c CONFIG $(CC) $(CPPFLAGS) $(CFLAGS) $(DE600_OPTS) -c $< @@ -110,48 +110,48 @@ $(CC) $(CPPFLAGS) $(CFLAGS) $(DE620_OPTS) -c $< ifdef CONFIG_AT1500 -NETDRV_OBJS := $(NETDRV_OBJS) net.a(lance.o) +NETDRV_OBJS := $(NETDRV_OBJS) lance.o endif ifdef CONFIG_LANCE -NETDRV_OBJS := $(NETDRV_OBJS) net.a(lance.o) +NETDRV_OBJS := $(NETDRV_OBJS) lance.o endif ifdef CONFIG_AT1700 -NETDRV_OBJS := $(NETDRV_OBJS) net.a(at1700.o) +NETDRV_OBJS := $(NETDRV_OBJS) at1700.o endif ifdef CONFIG_EL1 -NETDRV_OBJS := $(NETDRV_OBJS) net.a(3c501.o) +NETDRV_OBJS := $(NETDRV_OBJS) 3c501.o endif ifdef CONFIG_EL16 -NETDRV_OBJS := $(NETDRV_OBJS) net.a(3c507.o) +NETDRV_OBJS := $(NETDRV_OBJS) 3c507.o endif ifdef CONFIG_EL3 -NETDRV_OBJS := $(NETDRV_OBJS) net.a(3c509.o) +NETDRV_OBJS := $(NETDRV_OBJS) 3c509.o endif ifdef CONFIG_EEXPRESS -NETDRV_OBJS := $(NETDRV_OBJS) net.a(eexpress.o) +NETDRV_OBJS := $(NETDRV_OBJS) eexpress.o endif ifdef CONFIG_ZNET -NETDRV_OBJS := $(NETDRV_OBJS) net.a(znet.o) +NETDRV_OBJS := $(NETDRV_OBJS) znet.o endif ifdef CONFIG_DEPCA -NETDRV_OBJS := $(NETDRV_OBJS) net.a(depca.o) +NETDRV_OBJS := $(NETDRV_OBJS) depca.o depca.o: depca.c CONFIG $(CC) $(CPPFLAGS) $(CFLAGS) $(DEPCA_OPTS) -c $< endif ifdef CONFIG_ATP -NETDRV_OBJS := $(NETDRV_OBJS) net.a(atp.o) +NETDRV_OBJS := $(NETDRV_OBJS) atp.o endif ifdef CONFIG_NI52 -NETDRV_OBJS := $(NETDRV_OBJS) net.a(ni52.o) +NETDRV_OBJS := $(NETDRV_OBJS) ni52.o endif ifdef CONFIG_NI65 -NETDRV_OBJS := $(NETDRV_OBJS) net.a(ni65.o) +NETDRV_OBJS := $(NETDRV_OBJS) ni65.o endif ifdef CONFIG_ELPLUS -NETDRV_OBJS := $(NETDRV_OBJS) net.a(3c505.o) +NETDRV_OBJS := $(NETDRV_OBJS) 3c505.o endif ifdef CONFIG_AC3200 -NETDRV_OBJS := $(NETDRV_OBJS) net.a(ac3200.o) +NETDRV_OBJS := $(NETDRV_OBJS) ac3200.o CONFIG_8390 = CONFIG_8390 endif ifdef CONFIG_APRICOT @@ -159,17 +159,19 @@ endif ifdef CONFIG_8390 -NETDRV_OBJS := $(NETDRV_OBJS) net.a(8390.o) +NETDRV_OBJS := $(NETDRV_OBJS) 8390.o endif ifdef CONFIG_PI -NETDRV_OBJS := $(NETDRV_OBJS) net.a(pi2.o) +NETDRV_OBJS := $(NETDRV_OBJS) pi2.o CONFIG_PI = CONFIG_PI pi2.o: pi2.c CONFIG $(CC) $(CPPFLAGS) $(CFLAGS) $(PI_OPTS) -c $< endif net.a: $(NETDRV_OBJS) + rm -f net.a + ar rc net.a $(NETDRV_OBJS) ranlib net.a clean: diff -u --recursive v1.1.29/linux/drivers/scsi/scsi.c linux/drivers/scsi/scsi.c --- v1.1.29/linux/drivers/scsi/scsi.c Sat Jul 16 19:51:21 1994 +++ linux/drivers/scsi/scsi.c Sun Jul 17 16:25:29 1994 @@ -334,6 +334,13 @@ if (!the_result) { + /* It would seem some TOSHIBA CD-ROM gets things wrong */ + if (!strncmp(scsi_result+8,"TOSHIBA",7) && + !strncmp(scsi_result+16,"CD-ROM",6) && + scsi_result[0] == TYPE_DISK) { + scsi_result[0] = TYPE_ROM; + scsi_result[1] |= 0x80; /* removable */ + } SDpnt->removable = (0x80 & scsi_result[1]) >> 7; SDpnt->lockable = SDpnt->removable; @@ -617,14 +624,14 @@ SCpnt->request.nr_sectors -= req->nr_sectors; req->current_nr_sectors = bh->b_size >> 9; req->buffer = bh->b_data; - SCpnt->request.waiting = NULL; /* Wait until whole thing done */ + SCpnt->request.sem = NULL; /* Wait until whole thing done */ } else { req->dev = -1; wake_up(&wait_for_request); }; } else { SCpnt->request.dev = 0xffff; /* Busy, but no request */ - SCpnt->request.waiting = NULL; /* And no one is waiting for the device either */ + SCpnt->request.sem = NULL; /* And no one is waiting for the device either */ }; SCpnt->use_sg = 0; /* Reset the scatter-gather flag */ @@ -716,7 +723,7 @@ SCpnt->request.nr_sectors -= req->nr_sectors; req->current_nr_sectors = bh->b_size >> 9; req->buffer = bh->b_data; - SCpnt->request.waiting = NULL; /* Wait until whole thing done */ + SCpnt->request.sem = NULL; /* Wait until whole thing done */ } else { @@ -726,7 +733,7 @@ }; } else { SCpnt->request.dev = 0xffff; /* Busy */ - SCpnt->request.waiting = NULL; /* And no one is waiting for this to complete */ + SCpnt->request.sem = NULL; /* And no one is waiting for this to complete */ }; sti(); break; @@ -1914,7 +1921,7 @@ for(SCpnt=shpnt->host_queue; SCpnt; SCpnt = SCpnt->next) { /* (0) 0:0:0 (802 123434 8 8 0) (3 3 2) (%d %d %d) %d %x */ - printk("(%d) %d:%d:%d (%4.4x %d %d %d %d) (%d %d %x) (%d %d %d) %x %x %d %x\n", + printk("(%d) %d:%d:%d (%4.4x %d %d %d %d) (%d %d %x) (%d %d %d) %x %x %x\n", i, SCpnt->host->host_no, SCpnt->target, SCpnt->lun, @@ -1931,8 +1938,6 @@ SCpnt->internal_timeout, SCpnt->cmnd[0], SCpnt->sense_buffer[2], - (SCpnt->request.waiting ? - SCpnt->request.waiting->pid : 0), SCpnt->result); }; printk("wait_for_request = %x\n", wait_for_request); @@ -1945,14 +1950,12 @@ printk("%d: ", i); req = blk_dev[i].current_request; while(req) { - printk("(%x %d %d %d %d %d) ", + printk("(%x %d %d %d %d) ", req->dev, req->cmd, req->sector, req->nr_sectors, - req->current_nr_sectors, - (req->waiting ? - req->waiting->pid : 0)); + req->current_nr_sectors); req = req->next; } printk("\n"); diff -u --recursive v1.1.29/linux/drivers/scsi/scsi.h linux/drivers/scsi/scsi.h --- v1.1.29/linux/drivers/scsi/scsi.h Sat Jul 16 19:51:21 1994 +++ linux/drivers/scsi/scsi.h Sat Jul 16 22:24:36 1994 @@ -522,7 +522,6 @@ { struct request * req; struct buffer_head * bh; - struct task_struct * p; req = &SCpnt->request; req->errors = 0; @@ -554,12 +553,8 @@ return; }; DEVICE_OFF(req->dev); - if ((p = req->waiting) != NULL) { - req->waiting = NULL; - p->swapping = 0; - p->state = TASK_RUNNING; - if (p->counter > current->counter) - need_resched = 1; + if (req->sem != NULL) { + up(req->sem); } req->dev = -1; wake_up(&SCpnt->device->device_wait); diff -u --recursive v1.1.29/linux/drivers/scsi/scsi_ioctl.c linux/drivers/scsi/scsi_ioctl.c --- v1.1.29/linux/drivers/scsi/scsi_ioctl.c Thu Jul 14 00:48:24 1994 +++ linux/drivers/scsi/scsi_ioctl.c Sat Jul 16 22:24:36 1994 @@ -73,16 +73,12 @@ static void scsi_ioctl_done (Scsi_Cmnd * SCpnt) { struct request * req; - struct task_struct * p; req = &SCpnt->request; req->dev = 0xfffe; /* Busy, but indicate request done */ - if ((p = req->waiting) != NULL) { - req->waiting = NULL; - p->state = TASK_RUNNING; - if (p->counter > current->counter) - need_resched = 1; + if (req->sem != NULL) { + up(req->sem); } } @@ -97,8 +93,10 @@ MAX_RETRIES); if (SCpnt->request.dev != 0xfffe){ - SCpnt->request.waiting = current; - current->state = TASK_UNINTERRUPTIBLE; + struct semaphore sem = MUTEX_LOCKED; + SCpnt->request.sem = &sem; + down(&sem); + /* Hmm.. Have to ask about this one */ while (SCpnt->request.dev != 0xfffe) schedule(); }; @@ -181,8 +179,10 @@ MAX_RETRIES); if (SCpnt->request.dev != 0xfffe){ - SCpnt->request.waiting = current; - current->state = TASK_UNINTERRUPTIBLE; + struct semaphore sem = MUTEX_LOCKED; + SCpnt->request.sem = &sem; + down(&sem); + /* Hmm.. Have to ask about this one */ while (SCpnt->request.dev != 0xfffe) schedule(); }; diff -u --recursive v1.1.29/linux/drivers/scsi/sd.c linux/drivers/scsi/sd.c --- v1.1.29/linux/drivers/scsi/sd.c Thu Jul 14 00:48:24 1994 +++ linux/drivers/scsi/sd.c Sat Jul 16 22:24:37 1994 @@ -775,16 +775,12 @@ static void sd_init_done (Scsi_Cmnd * SCpnt) { struct request * req; - struct task_struct * p; req = &SCpnt->request; req->dev = 0xfffe; /* Busy, but indicate request done */ - if ((p = req->waiting) != NULL) { - req->waiting = NULL; - p->state = TASK_RUNNING; - if (p->counter > current->counter) - need_resched = 1; + if (req->sem != NULL) { + up(req->sem); } } @@ -884,8 +880,10 @@ while(SCpnt->request.dev != 0xfffe); else if (SCpnt->request.dev != 0xfffe){ - SCpnt->request.waiting = current; - current->state = TASK_UNINTERRUPTIBLE; + struct semaphore sem = MUTEX_LOCKED; + SCpnt->request.sem = &sem; + down(&sem); + /* Hmm.. Have to ask about this one.. */ while (SCpnt->request.dev != 0xfffe) schedule(); }; diff -u --recursive v1.1.29/linux/drivers/scsi/sr.c linux/drivers/scsi/sr.c --- v1.1.29/linux/drivers/scsi/sr.c Thu Jul 14 00:48:25 1994 +++ linux/drivers/scsi/sr.c Sat Jul 16 22:24:37 1994 @@ -641,11 +641,8 @@ req = &SCpnt->request; req->dev = 0xfffe; /* Busy, but indicate request done */ - if ((p = req->waiting) != NULL) { - req->waiting = NULL; - p->state = TASK_RUNNING; - if (p->counter > current->counter) - need_resched = 1; + if (req->sem != NULL) { + up(req->sem); } } @@ -675,8 +672,10 @@ while(SCpnt->request.dev != 0xfffe); else if (SCpnt->request.dev != 0xfffe){ - SCpnt->request.waiting = current; - current->state = TASK_UNINTERRUPTIBLE; + struct semaphore sem = MUTEX_LOCKED; + SCpnt->request.sem = &sem; + down(&sem); + /* Hmm.. Have to ask about this */ while (SCpnt->request.dev != 0xfffe) schedule(); }; diff -u --recursive v1.1.29/linux/drivers/scsi/sr_ioctl.c linux/drivers/scsi/sr_ioctl.c --- v1.1.29/linux/drivers/scsi/sr_ioctl.c Thu Jul 14 00:48:25 1994 +++ linux/drivers/scsi/sr_ioctl.c Sat Jul 16 22:24:37 1994 @@ -26,11 +26,8 @@ req = &SCpnt->request; req->dev = 0xfffe; /* Busy, but indicate request done */ - if ((p = req->waiting) != NULL) { - req->waiting = NULL; - p->state = TASK_RUNNING; - if (p->counter > current->counter) - need_resched = 1; + if (req->sem != NULL) { + up(&req->sem); } } @@ -50,8 +47,10 @@ if (SCpnt->request.dev != 0xfffe){ - SCpnt->request.waiting = current; - current->state = TASK_UNINTERRUPTIBLE; + struct semaphore sem = MUTEX_LOCKED; + SCpnt->request.sem = &sem; + down(&sem); + /* Hmm.. Have to ask about this */ while (SCpnt->request.dev != 0xfffe) schedule(); }; diff -u --recursive v1.1.29/linux/fs/proc/base.c linux/fs/proc/base.c --- v1.1.29/linux/fs/proc/base.c Wed Dec 1 14:44:15 1993 +++ linux/fs/proc/base.c Sun Jul 17 16:28:26 1994 @@ -70,7 +70,7 @@ int proc_match(int len,const char * name,struct proc_dir_entry * de) { - register int same __asm__("ax"); + register int same; if (!de || !de->low_ino) return 0; @@ -79,7 +79,8 @@ return 1; if (de->namelen != len) return 0; - __asm__("cld\n\t" + __asm__ __volatile__( + "cld\n\t" "repe ; cmpsb\n\t" "setz %%al" :"=a" (same) diff -u --recursive v1.1.29/linux/include/linux/fs.h linux/include/linux/fs.h --- v1.1.29/linux/include/linux/fs.h Fri Jul 8 13:26:41 1994 +++ linux/include/linux/fs.h Sat Jul 16 22:25:35 1994 @@ -177,6 +177,7 @@ time_t i_ctime; unsigned long i_blksize; unsigned long i_blocks; + unsigned long i_version; struct semaphore i_sem; struct inode_operations * i_op; struct super_block * i_sb; diff -u --recursive v1.1.29/linux/include/linux/sched.h linux/include/linux/sched.h --- v1.1.29/linux/include/linux/sched.h Sat Jul 16 19:51:21 1994 +++ linux/include/linux/sched.h Sat Jul 16 22:24:37 1994 @@ -264,7 +264,6 @@ unsigned long personality; int dumpable:1; int did_exec:1; - volatile int swapping:1; int pid,pgrp,session,leader; int groups[NGROUPS]; /* @@ -332,7 +331,7 @@ /* schedlink */ &init_task,&init_task, \ /* signals */ {{ 0, },}, \ /* stack */ 0,(unsigned long) &init_kernel_stack, \ -/* ec,brk... */ 0,0,0,0,0,0, \ +/* ec,brk... */ 0,0,0,0,0, \ /* pid etc.. */ 0,0,0,0, \ /* suppl grps*/ {NOGROUP,}, \ /* proc links*/ &init_task,&init_task,NULL,NULL,NULL,NULL, \ diff -u --recursive v1.1.29/linux/include/linux/string.h linux/include/linux/string.h --- v1.1.29/linux/include/linux/string.h Fri May 27 10:49:15 1994 +++ linux/include/linux/string.h Sat Jul 16 18:46:55 1994 @@ -25,7 +25,8 @@ extern inline char * strcpy(char * dest,const char *src) { -__asm__("cld\n" +__asm__ __volatile__( + "cld\n" "1:\tlodsb\n\t" "stosb\n\t" "testb %%al,%%al\n\t" @@ -37,7 +38,8 @@ extern inline char * strncpy(char * dest,const char *src,size_t count) { -__asm__("cld\n" +__asm__ __volatile__( + "cld\n" "1:\tdecl %2\n\t" "js 2f\n\t" "lodsb\n\t" @@ -54,7 +56,8 @@ extern inline char * strcat(char * dest,const char * src) { -__asm__("cld\n\t" +__asm__ __volatile__( + "cld\n\t" "repne\n\t" "scasb\n\t" "decl %1\n" @@ -69,7 +72,8 @@ extern inline char * strncat(char * dest,const char * src,size_t count) { -__asm__("cld\n\t" +__asm__ __volatile__( + "cld\n\t" "repne\n\t" "scasb\n\t" "decl %1\n\t" @@ -90,8 +94,9 @@ extern inline int strcmp(const char * cs,const char * ct) { -register int __res __asm__("ax"); -__asm__("cld\n" +register int __res; +__asm__ __volatile__( + "cld\n" "1:\tlodsb\n\t" "scasb\n\t" "jne 2f\n\t" @@ -108,8 +113,9 @@ extern inline int strncmp(const char * cs,const char * ct,size_t count) { -register int __res __asm__("ax"); -__asm__("cld\n" +register int __res; +__asm__ __volatile__( + "cld\n" "1:\tdecl %3\n\t" "js 2f\n\t" "lodsb\n\t" @@ -128,8 +134,9 @@ extern inline char * strchr(const char * s,char c) { -register char * __res __asm__("ax"); -__asm__("cld\n\t" +register char * __res; +__asm__ __volatile__( + "cld\n\t" "movb %%al,%%ah\n" "1:\tlodsb\n\t" "cmpb %%ah,%%al\n\t" @@ -145,8 +152,9 @@ extern inline char * strrchr(const char * s,char c) { -register char * __res __asm__("dx"); -__asm__("cld\n\t" +register char * __res; +__asm__ __volatile__( + "cld\n\t" "movb %%al,%%ah\n" "1:\tlodsb\n\t" "cmpb %%ah,%%al\n\t" @@ -160,8 +168,9 @@ extern inline size_t strspn(const char * cs, const char * ct) { -register char * __res __asm__("si"); -__asm__("cld\n\t" +register char * __res; +__asm__ __volatile__( + "cld\n\t" "movl %4,%%edi\n\t" "repne\n\t" "scasb\n\t" @@ -184,8 +193,9 @@ extern inline size_t strcspn(const char * cs, const char * ct) { -register char * __res __asm__("si"); -__asm__("cld\n\t" +register char * __res; +__asm__ __volatile__( + "cld\n\t" "movl %4,%%edi\n\t" "repne\n\t" "scasb\n\t" @@ -208,8 +218,9 @@ extern inline char * strpbrk(const char * cs,const char * ct) { -register char * __res __asm__("si"); -__asm__("cld\n\t" +register char * __res; +__asm__ __volatile__( + "cld\n\t" "movl %4,%%edi\n\t" "repne\n\t" "scasb\n\t" @@ -235,8 +246,9 @@ extern inline char * strstr(const char * cs,const char * ct) { -register char * __res __asm__("ax"); -__asm__("cld\n\t" \ +register char * __res; +__asm__ __volatile__( + "cld\n\t" \ "movl %4,%%edi\n\t" "repne\n\t" "scasb\n\t" @@ -262,8 +274,9 @@ extern inline size_t strlen(const char * s) { -register int __res __asm__("cx"); -__asm__("cld\n\t" +register int __res; +__asm__ __volatile__( + "cld\n\t" "repne\n\t" "scasb\n\t" "notl %0\n\t" @@ -277,7 +290,8 @@ extern inline char * strtok(char * s,const char * ct) { register char * __res; -__asm__("testl %1,%1\n\t" +__asm__ __volatile__( + "testl %1,%1\n\t" "jne 1f\n\t" "testl %0,%0\n\t" "je 8f\n\t" @@ -335,7 +349,8 @@ extern inline void * memcpy(void * to, const void * from, size_t n) { -__asm__("cld\n\t" +__asm__ __volatile__( + "cld\n\t" "movl %%edx, %%ecx\n\t" "shrl $2,%%ecx\n\t" "rep ; movsl\n\t" @@ -355,14 +370,16 @@ extern inline void * memmove(void * dest,const void * src, size_t n) { if (destbinfmt->use_count)++; p->did_exec = 0; - p->swapping = 0; p->kernel_stack_page = 0; p->state = TASK_UNINTERRUPTIBLE; p->flags &= ~(PF_PTRACED|PF_TRACESYS); diff -u --recursive v1.1.29/linux/net/Makefile linux/net/Makefile --- v1.1.29/linux/net/Makefile Tue May 24 00:34:59 1994 +++ linux/net/Makefile Thu Jul 14 20:27:23 1994 @@ -23,12 +23,12 @@ OBJS = socket.o protocols.o -all: subdirs net.o +all: net.o net.o: $(OBJS) network.a $(LD) -r -o net.o $(OBJS) network.a -network.a: $(SUBOBJS) +network.a: subdirs rm -f $@ ar rc $@ $(SUBOBJS) ranlib $@ diff -u --recursive v1.1.29/linux/net/inet/tcp.c linux/net/inet/tcp.c --- v1.1.29/linux/net/inet/tcp.c Thu Jul 14 00:48:27 1994 +++ linux/net/inet/tcp.c Sat Jul 16 19:04:11 1994 @@ -155,7 +155,7 @@ #include #include -#define TCP_FASTPATH +#undef TCP_FASTPATH #define SEQ_TICK 3 unsigned long seq_offset;