add directory Linux-0.97

This commit is contained in:
gohigh
2024-02-19 00:21:05 -05:00
parent cf5dadaed5
commit 265896c4ae
91 changed files with 2648 additions and 0 deletions

View File

@@ -0,0 +1,67 @@
*** linux/kernel/sys_call.S Fri May 15 08:56:45 1992
--- linux/kernel/sys_call.S.~1~ Sun May 10 13:59:58 1992
***************
*** 87,97 ****
.globl _double_fault,_coprocessor_segment_overrun
.globl _invalid_TSS,_segment_not_present,_stack_segment
.globl _general_protection,_irq13,_reserved
.globl _alignment_check,_page_fault
.globl _keyboard_interrupt,_hd_interrupt
! .globl _IRQ3_interrupt,_IRQ4_interrupt,_irq5_interrupt
#define SAVE_ALL \
cld; \
push %gs; \
push %fs; \
--- 87,97 ----
.globl _double_fault,_coprocessor_segment_overrun
.globl _invalid_TSS,_segment_not_present,_stack_segment
.globl _general_protection,_irq13,_reserved
.globl _alignment_check,_page_fault
.globl _keyboard_interrupt,_hd_interrupt
! .globl _IRQ3_interrupt,_IRQ4_interrupt
#define SAVE_ALL \
cld; \
push %gs; \
push %fs; \
***************
*** 265,285 ****
pushl $-1
SAVE_ALL
ACK_FIRST(0x10)
sti
call _do_IRQ4
- cli
- UNBLK_FIRST(0x10)
- jmp ret_from_sys_call
-
- .align 2
- _irq5_interrupt:
- pushl $-1
- SAVE_ALL
- ACK_FIRST(0x10)
- sti
- call _wd8003_interrupt
cli
UNBLK_FIRST(0x10)
jmp ret_from_sys_call
.align 2
--- 265,274 ----
*** linux/init/main.c Fri May 15 09:01:02 1992
--- linux/init/main.c.~1~ Sat May 2 19:29:31 1992
***************
*** 173,183 ****
sched_init();
buffer_init(buffer_memory_end);
hd_init();
floppy_init();
sock_init();
- wd8003_init();
sti();
#ifdef CONFIG_SCSI
scsi_dev_init();
#endif
move_to_user_mode();
--- 173,182 ----

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,25 @@
#define ETHERMTU 2048
#define ETHER_MIN_LEN 64
#define ETHER_ADDR_LEN 6
/* this must be a power of 2 */
#define ETH_BUFF_SIZE 0x2000
/* some ioctls. */
#define ETH_START 0
#define ETH_STOP 1
typedef void * (*callback)(void *);
#define ETHERTYPE_ARP 0x806
#define ETHERTYPE_IP 0x800
#define NET16(x) (((x)<<8)|(x)&0xff)
struct enet_header
{
unsigned char saddr[ETHER_ADDR_LEN];
unsigned char daddr[ETHER_ADDR_LEN];
unsigned short type;
};
#define ETHER_HEADER sizeof(enet_header)

View File

@@ -0,0 +1,789 @@
/* we.c an wd8003 ethernet driver for linux. */
/*
Copyright (C) 1992 Ross Biro
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 1, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
The Author may be reached as bir7@leland.stanford.edu or
C/O Department of Mathematics; Stanford University; Stanford, CA 94305
*/
/* The bsd386 version was used as an example in order to write this
code */
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/fs.h>
#include <linux/tty.h>
#include <sys/types.h>
/* #include <linux/driver.h>*/
#include <linux/eth.h>
#include <asm/system.h>
#include <asm/segment.h>
#include <asm/io.h>
#include <asm/memory.h>
#include <errno.h>
#include <fcntl.h>
#include "wereg.h"
static unsigned char interrupt_mask;
/* format of status byte.
bit
0 start
1 open
2 transmitter in use */
#define START 1
#define OPEN 2
#define TRS_BUSY 4
static unsigned int status;
struct driver {
struct task_struct **d_rwait;
struct task_struct **d_wwait;
} builtin_dev;
static unsigned char we_addr[ETHER_ADDR_LEN];
static struct driver *mdev;
static int recv_errors=0;
static int trans_errors=0;
static int spackets=0;
static int collisions=0;
static struct task_struct *wwait_ptr=NULL;
static struct task_struct *rwait_ptr=NULL;
extern void irq5_interrupt(void);
static inline int
min(int a, int b)
{
if (a<b) return (a);
return (b);
}
static inline int
max(int a, int b)
{
if (a>b) return (a);
return (b);
}
struct bufhead
{
long len;
};
struct buf
{
short head, tail;
unsigned char *memory;
};
static unsigned char rbuf_c[ETH_BUFF_SIZE];
static unsigned char wbuf_c[ETH_BUFF_SIZE];
static struct buf Buf[]=
{
{0,0,rbuf_c},
{0,0,wbuf_c}
};
static struct buf *rbuf = Buf;
static struct buf *wbuf = Buf+1;
static inline int
buf_free(struct buf *b)
{
if (b->head >= b->tail)
return(ETH_BUFF_SIZE-b->head +b->tail);
else
return (b->tail-b->head);
}
static inline void
clear_buf(struct buf *b)
{
b->head=0;
b->tail=0;
}
static inline int
copy_to_buf(struct buf *b, void *vptr, long len,
void *end_buff, callback split)
{
struct bufhead *head;
long end;
long bend;
long total=0;
unsigned char *ptr;
/* check to see if there is enough space. */
if (len+3*sizeof(*head) >=
buf_free(b))
{
return(0);
}
head = (struct bufhead *)(b->memory + b->head);
head->len = len;
b->head += sizeof (*head);
ptr = vptr;
while (len > 0)
{
end = ETH_BUFF_SIZE - b->head;
bend = (unsigned long)end_buff - (unsigned long)ptr;
if (bend <= 0)
{
ptr =split(ptr);
bend = (unsigned long)end_buff - (unsigned long)ptr;
}
/* copy up to the end of a buffer. */
end = min(end,bend);
end = min (end,len);
if (end < 0)
{
printk ("copy_to_buf end=%d\n",end);
end=0;
}
(void) memcpy (b->memory+b->head, ptr,end);
ptr += end;
len -= end;
b->head+=end;
total += end;
if (b->head >= ETH_BUFF_SIZE)
b->head = 0;
}
if (b->head >= ETH_BUFF_SIZE-2*sizeof(*head))
b->head = 0;
return (total);
}
static inline int
copy_to_buf_fs(struct buf *b, void *vptr, unsigned long len)
{
struct bufhead *head;
unsigned long end;
unsigned char *ptr;
/* check to see if there is enough space. */
if (len+3*sizeof(*head) >=
buf_free(b))
{
printk ("copy_to_buf_fs failed %d\n",len);
return(0);
}
head = (struct bufhead *)(b->memory + b->head);
head->len = len;
b->head += sizeof (*head);
end = ETH_BUFF_SIZE - b->head;
ptr = vptr;
/* copy up to the end of the buffer. */
end = min(end,len);
memcpy_fromfs (b->memory+b->head, ptr,end);
ptr += end;
len -= end;
b->head+=end;
if (b->head >= ETH_BUFF_SIZE)
b->head = 0;
/* now copy the rest. */
memcpy_fromfs (b->memory+b->head, ptr, len);
b->head += len;
if (b->head >= ETH_BUFF_SIZE-2*sizeof(*head))
b->head = 0;
return (end + len);
}
static inline int
copy_from_buf(struct buf *b, void *vptr, long len)
{
struct bufhead *head;
long end;
unsigned char *ptr;
/* check to see if there is anything in the buffer. */
if (b->head == b->tail)
return(0);
head = (struct bufhead *)(b->memory + b->tail);
b->tail += sizeof (*head);
len = min (head->len,len);
end = ETH_BUFF_SIZE - b->tail;
ptr = vptr;
/* copy up to the end of the buffer. */
end = min(end,len);
if (end < 0)
{
printk ("copy from buf end = %d\n",end);
end = 0;
}
(void) memcpy (ptr, b->memory+b->tail, end);
ptr += end;
len -= end;
b->tail+=end;
if (b->tail >= ETH_BUFF_SIZE)
b->tail = 0;
/* now copy the rest. */
(void )memcpy (ptr, b->memory+b->tail, len);
/* now forget about any leftover stuff. */
b->tail += head->len - end;
if (b->tail >= ETH_BUFF_SIZE)
b->tail-=ETH_BUFF_SIZE;
if (b->tail >= ETH_BUFF_SIZE-2*sizeof(*head))
b->tail = 0;
return (end + len);
}
static inline int
copy_from_buf_fs(struct buf *b, void *vptr, unsigned long len)
{
struct bufhead *head;
unsigned long end;
unsigned char *ptr;
/* check to see if there is anything in the buffer. */
if (b->head == b->tail)
return(0);
head = (struct bufhead *)(b->memory + b->tail);
b->tail += sizeof (*head);
len = min (head->len,len);
end = ETH_BUFF_SIZE - b->tail;
ptr = vptr;
/* copy up to the end of the buffer. */
end = min(end,len);
memcpy_tofs (ptr, b->memory+b->tail, end);
ptr += end;
len -= end;
b->tail+=end;
if (b->tail >= ETH_BUFF_SIZE)
b->tail = 0;
/* now copy the rest. */
if (len != 0)
{
memcpy_tofs (ptr,b->memory+b->tail, len);
}
/* now forget about any leftover stuff. */
b->tail += head->len - end;
if (b->tail >= ETH_BUFF_SIZE)
b->tail-=ETH_BUFF_SIZE;
if (b->tail >= ETH_BUFF_SIZE-2*sizeof(*head))
b->tail = 0;
return (end + len);
}
void
wd_stop(void)
{
unsigned char cmd;
cli();
cmd = inb_p(WD_COMM);
cmd |= CSTOP;
cmd &= ~(CSTART|CPAGE);
outb_p(cmd, WD_COMM);
outb(0,WD_IMR);
sti();
interrupt_mask = 0;
status &= ~START;
}
static inline void
wd_start(void)
{
unsigned char cmd;
interrupt_mask=RECV_MASK;
cli();
cmd = inb_p(WD_COMM);
cmd &= ~(CSTOP|CPAGE);
cmd |= CSTART;
outb_p(cmd, WD_COMM);
outb(interrupt_mask,WD_IMR);
sti();
status |= START;
}
int wd8003_close(struct inode *inode, struct file *filep)
{
int minor;
minor = MINOR(inode->i_rdev);
if (minor != 0) return (-ENODEV);
wd_stop();
status = 0;
return (0);
}
int
wd8003_open(struct inode *inode, struct file *filep)
{
unsigned char cmd;
int i;
int minor;
minor = MINOR(inode->i_rdev);
if (minor != 0) return (-ENODEV);
if (status & OPEN) return (-EBUSY);
/* clear the buffs. */
clear_buf(rbuf);
clear_buf(wbuf);
/* we probably don't want to be interrupted here. */
cli();
/* This section of code is mostly copied from the bsd driver which is
mostly copied from somewhere else. */
cmd=inb_p(WD_COMM);
cmd|=CSTOP;
cmd &= ~(CSTART|CPAGE);
outb_p(cmd, WD_COMM);
outb_p(0, WD_IMR);
sti();
outb_p(WD_DCONFIG,WD_DCR);
/*Zero the remote byte count. */
outb_p(0, WD_RBY0);
outb_p(0, WD_RBY1);
outb_p(WD_MCONFIG,WD_RCC);
outb_p(WD_TCONFIG,WD_TRC);
/* Set the transmit page */
outb_p(0,WD_TRPG);
outb_p(WD_TXBS,WD_PSTRT);
outb_p(WD_MAX_PAGES,WD_PSTOP);
outb_p(WD_TXBS,WD_BNDR);
/* clear interrupt status. */
outb_p(0xff,WD_ISR);
/* we don't want no stinking interrupts. */
outb_p(0 ,WD_IMR);
cmd|=1<<CPAGE_SHIFT;
outb_p(cmd,WD_COMM);
/* set the either address. */
for (i=0; i < ETHER_ADDR_LEN; i++)
{
outb_p(we_addr[i],WD_PAR0+i);
}
/* set the multicast address. */
for (i=0; i < ETHER_ADDR_LEN; i++)
{
outb_p(0xff,WD_MAR0+i);
}
outb_p(WD_TXBS,WD_CUR);
cmd&=~(CPAGE|CRDMA);
cmd|= 4<<CRDMA_SHIFT;
outb_p(cmd, WD_COMM);
outb_p(WD_RCONFIG,WD_RCC);
status = OPEN;
wd_start();
return (0);
}
static void *
wd_callback(void *ptr)
{
if (ptr >= (void *)WD_BUFFEND)
return ((void *)(WD_MEM + (WD_TXBS<<8)));
return (ptr);
}
/*This routine just copies the stuff from the ring into the
buffer. It remove the ring headers, and makes sure that
everything fits. */
static inline int
wdget(struct wd_ring *ring)
{
unsigned char *fptr;
unsigned long len;
int i;
fptr = (unsigned char *)(ring +1);
len = ring->count-4;
for (i =0; i < ETHER_ADDR_LEN; i++)
if (fptr[i] != we_addr[i])
{
return (0);
}
if (copy_to_buf (rbuf, fptr, len,(void *) WD_BUFFEND, wd_callback)
!= len) return (1);
return (0);
}
/* wd_strans attempts to start a transmission. It is
only called when the transmit buffer is free. */
static inline void
wd_strans(void)
{
unsigned long len;
unsigned char cmd;
len = copy_from_buf(wbuf,(void *)WD_MEM,WD_TXBS<<8);
/* see if there is anything to send. */
if (len == 0)
{
interrupt_mask &= ~TRANS_MASK;
status &= ~(TRS_BUSY);
return;
}
status |= TRS_BUSY;
/* now we need to set up the card info. */
len=max(len, ETHER_MIN_LEN);
cmd=inb_p(WD_COMM);
outb_p(len&0xff,WD_TB0);
outb_p(len>>8,WD_TB1);
cmd |= CTRANS;
outb(cmd,WD_COMM);
interrupt_mask |= TRANS_MASK;
}
int
rw_wd8003(int rw, unsigned minor, char *buf, int count, unsigned short flags )
{
unsigned long len=0;
unsigned char cmd;
if (minor != 0) return (-ENODEV);
if (rw == READ)
{
while (len == 0)
{
verify_area(buf, count);
len = copy_from_buf_fs(rbuf,buf, count);
if (len == 0)
{
clear_buf(rbuf);
if ( flags & O_NONBLOCK)
{
return (-EAGAIN);
}
interruptible_sleep_on(mdev->d_rwait);
}
}
}
else
{
while (len == 0)
{
verify_area(buf, count);
len = copy_to_buf_fs(wbuf,buf, count);
if (len == 0)
{
clear_buf(wbuf);
if ( flags & O_NONBLOCK)
{
return (-EAGAIN);
}
interruptible_sleep_on(mdev->d_wwait);
}
}
/* see if we need to start the transmission. */
if (!(status & TRS_BUSY))
{
cli();
cmd = inb_p(WD_COMM);
cmd &= ~(CPAGE);
outb_p(cmd, WD_COMM);
outb_p(0, WD_IMR);
sti();
wd_strans();
outb_p(interrupt_mask,WD_IMR);
}
}
return (len);
}
static int
wd8003_read (struct inode *inode, struct file *file, char *buf, int count)
{
return (rw_wd8003(READ, MINOR(inode->i_rdev), buf, count, file->f_flags));
}
static int
wd8003_write (struct inode *inode, struct file *file, char *buf, int count)
{
return (rw_wd8003(WRITE, MINOR(inode->i_rdev), buf, count, file->f_flags));
}
/* This routine handles the packet recieved interrupt. */
/* It is called with interrupts enabled, but with
the wd card configured not to return interrupts. */
/* It is enterred with page one selected, and it must
leave that way. */
/* I think there might be an infinite loop here, so I'm putting
in a maximum number of packets we can look at at once.
Someone with good docs can try to fix this one. */
static inline void
wd_rcv(void)
{
unsigned char bnd;
unsigned char cur;
unsigned char cmd;
struct wd_ring *ring;
int count = 0;
cmd=inb_p(WD_COMM);
bnd=inb_p(WD_BNDR);
cmd |= 1<< CPAGE_SHIFT;
outb_p (cmd, WD_COMM);
cur=inb(WD_CUR);
while (bnd != cur)
{
count++;
if (count > 10)
{
bnd=cur;
break;
}
ring = (struct wd_ring *)(WD_MEM + (bnd << 8));
if (ring->count > 34 && ring->count <= ETHERMTU+104)
{
if (wdget(ring))
{
/* we have a buffer overflow. */
/* reset the bndry and the current. */
cmd |= CSTOP;
outb_p(cmd,WD_COMM);
outb_p(WD_MCONFIG,WD_RCC);
outb_p(WD_TXBS,WD_BNDR);
cmd |= 1 <<CPAGE_SHIFT;
outb_p(cmd, WD_COMM);
outb_p(WD_TXBS,WD_CUR);
cmd &= ~(CSTOP|CPAGE);
cmd |= CSTART;
outb_p(cmd, WD_COMM);
outb_p(WD_RCONFIG,WD_RCC);
return;
}
wake_up(mdev->d_rwait);
}
else
{
bnd=cur;
break;
}
/* compute a new boundary. */
if (ring->next >= WD_MAX_PAGES)
{
bnd= ring->next - WD_MAX_PAGES + WD_TXBS;
}
else
{
bnd=ring->next;
if (bnd <= WD_TXBS)
{
bnd += WD_TXBS;
}
}
/* tell the card about the new boundary. */
cmd &=~(CPAGE);
outb_p(cmd,WD_COMM);
if (bnd != WD_TXBS)
outb_p(bnd-1,WD_BNDR);
else
outb_p(WD_MAX_PAGES-1,WD_BNDR);
cmd |= 1<< CPAGE_SHIFT;
outb_p(cmd,WD_COMM);
/* update our copy of cur. */
cur = inb_p(WD_CUR);
}
/* we have to make sure we reset the i/o page. */
cmd &= ~(CPAGE);
outb_p(cmd,WD_COMM);
if (bnd != WD_TXBS)
outb_p(bnd-1, WD_BNDR);
else
outb_p(WD_MAX_PAGES-1, WD_BNDR);
}
/* This get's the transmit interrupts.
It assume command page 0 is set, and
returns with command page 0 set. */
static inline void
wd_trs(void)
{
/*update the stats. */
spackets++;
collisions += inb(WD_TB0);
/* attempt to start a transmission. */
wd_strans();
/* wakeup anything that was sleeping on writes. */
if (*(mdev->d_wwait)) wake_up(mdev->d_wwait);
}
/* Currently this routine sometimes gets stuck in an infinite
loop. So I'm putting in a counter. When the routine
has looped 10 times, I'm just resetting everything,
then leaving. Someone who has real docs can fix this. */
void
wd8003_interrupt(void)
{
unsigned char cmd;
unsigned char isr;
int count=0;
/* Acknowledge the interrupt. */
outb_p(0x20,0x20);
/* now we can be interrupted, but since we have
done nothing yet it doesn't matter. */
/*we don't want to be interrupted after we
read the command byte. */
cli();
cmd=inb_p(WD_COMM);
cmd&=~(CPAGE);
outb_p(cmd,WD_COMM);
isr=inb(WD_ISR);
do {
outb_p(0,WD_IMR);
/* we have turned the wd8003 interrupts off, so we can reenable
them at the processor level. */
sti();
/* From now on other devices will be able to interrupt us, so
some care is probably required. */
count++;
if (count > 10)
{
printk ("wd8003:Warning loop broken\n");
/* we are caught in a loop, reset everything that we can think
of and return. This needs to be fixed. */
cmd |= CSTOP;
outb_p(cmd,WD_COMM);
outb_p(WD_IMEM|0x80,WD_CTL);
outb_p(WD_IMEM,WD_CTL);
outb_p(WD_MCONFIG,WD_RCC);
outb_p(WD_TXBS,WD_BNDR);
cmd |= 1 <<CPAGE_SHIFT;
outb_p(cmd, WD_COMM);
outb_p(WD_TXBS,WD_CUR);
cmd &= ~(CSTOP|CPAGE);
cmd |= CSTART;
outb_p(cmd, WD_COMM);
outb_p(WD_RCONFIG,WD_RCC);
outb_p (0,WD_ISR);
outb_p(interrupt_mask,WD_IMR);
return;
}
/* see what to do about the interrupt. */
if (isr & IRCV) /* got a packet. */
wd_rcv();
if (isr & ITRS) /* finished sending a packet. */
wd_trs();
if (isr & IRCE) /* recieve error */
{
/* reading these registers might clear the error condition. */
collisions += inb(WD_TB0);
(void) inb(WD_RCC);
(void) inb(WD_DCR);
recv_errors++;
}
if (isr & ITRE) /* transmit error. */
{
collisions += inb(WD_TB0);
trans_errors++;
}
/* acknowledge the intterupt. */
outb_p(isr, WD_ISR);
/* Now we will try to reenable onboard interrupts. */
cli();
outb_p(interrupt_mask,WD_IMR);
isr=inb_p(WD_ISR)&interrupt_mask;
} while (isr != 0);
sti();
}
int
wd8003_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned int arg)
{
int dev;
dev=MINOR(inode->i_rdev);
if (dev != 0) return (-ENODEV);
switch (cmd)
{
case ETH_START:
wd_start();
return (0);
case ETH_STOP:
wd_stop();
return(0);
default:
return (-EINVAL);
}
}
static struct file_operations wd_fops =
{
NULL,
wd8003_read,
wd8003_write,
NULL,
NULL,
wd8003_ioctl,
wd8003_open,
wd8003_close
};
void
wd8003_init(struct driver *dev)
{
unsigned char csum;
int i;
chrdev_fops[10]=&wd_fops;
mdev = &builtin_dev;
mdev->d_rwait = &rwait_ptr;
mdev->d_wwait = &wwait_ptr;
csum = 0;
for (i = 0; i < 8; i++)
{
csum += inb_p(WD_ROM+i);
}
if (csum != WD_CHECK)
{
printk ("Warning no WD8003 board installed.\n");
/* make sure no one can attempt to open the device. */
status = OPEN;
return;
}
/* mapin the interface memory. */
outb(WD_IMEM,WD_CTL);
/* clear the interface memory */
for (i = 0; i < WD_MEMSIZE; i++)
{
((unsigned char *)WD_MEM)[i] = 0;
if (((unsigned char *)WD_MEM)[i] != 0)
{
printk ("WD Memory error.\n");
status = OPEN;
}
}
/* print the initialization message, and the
ethernet address. */
printk ("WD8003 ethernet Address ");
for (i = 0; i <ETHER_ADDR_LEN; i++)
{
we_addr[i]=inb_p(WD_ROM+i);
printk ("%2.2X ",we_addr[i]);
}
printk ("\n");
status = 0;
set_trap_gate (0x25, irq5_interrupt);
outb(inb_p(0x21)&0xDF, 0x21);
}

View File

@@ -0,0 +1,131 @@
/* wereg.h */
/*
Copyright (C) 1992 Ross Biro
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 1, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
The Author may be reached as bir7@leland.stanford.edu or
C/O Department of Mathematics; Stanford University; Stanford, CA 94305
*/
/* This is based on if_wereg.h from bsd386 */
struct wd_ring
{
unsigned char status; /* status */
/* format of status
bit
0 packet ok
1 crc error
2 frame alignment error
3 fifo overrun
*/
#define STRECVD 0xf1
unsigned char next; /* pointer to next packet. */
unsigned short count; /*packet lenght in bytes + 4 */
};
/* Format of command register.
bits
0 stop
1 start
2 transmit packet
3-5 Remote DMA command
6-7 Page Select */
#define CSTOP 0x1
#define CSTART 0x2
#define CTRANS 0x4
#define CRDMA 0x38
#define CRDMA_SHIFT 3
#define CPAGE 0xc0
#define CPAGE_SHIFT 6
/* interrupt status defenitions
bits
0 Recv.
1 Transmit
2 RcvErr
3 Transmit Err
4 Overwrite warning
5 Counter overflow
6 Remote DMA complete
7 Reset Status */
#define IRCV 0x1
#define ITRS 0x2
#define IRCE 0x4
#define ITRE 0x8
/* transmit status format
bits
0 Packet transmitted ok.
1 Non Deferred transmition
2 Transmit collied
3 Transmit aborted
4 Carrier Sense Lost
5 Fifo Underrun
6 CD Heartbeat
7 Out of Window Collision */
#define TROK 0x1
#define TRAB 0x4
/* Some ID stuff */
#define WD_ID1 0x03
#define WD_ID2 0x05
#define WD_CHECK 0xff
#define WD_PAGE 256 /* page size in bytes. */
#define WD_TXBS 6 /* size of transmit buffer in pages. */
#define WD_MAX_PAGES 32 /* Number of pages off ram on card (8k) */
#define WD_NIC 16 /* i/o base offset to NIC */
/* Some configuration stuff. */
/* where the memory is mapped in. */
#define WD_MEM 0xd0000
#define WD_BUFFEND 0xd4000
#define WD_MEMSIZE (WD_BUFFEND-WD_MEM)
#define WD_BASE 0x280
#define TRANS_MASK 0xa
#define RECV_MASK 0x5
#define WD_DCONFIG 0x48
#define WD_RCONFIG 0x4
#define WD_MCONFIG 0x20
#define WD_TCONFIG 0x0
#define WD_IMEM (((WD_MEM>>13) & 0x3f)|0x40)
/* WD registers. */
#define WD_ROM (WD_BASE+8)
#define WD_CTL (WD_BASE+0)
/* WD NIC register offsets */
#define WD_COMM (WD_BASE+WD_NIC+0x00) /* command register */
#define WD_PSTRT (WD_BASE+WD_NIC+0x01) /* page start register */
#define WD_PSTOP (WD_BASE+WD_NIC+0x02) /* page stop register */
#define WD_BNDR (WD_BASE+WD_NIC+0x03) /* Boundary Pointer */
#define WD_TRST (WD_BASE+WD_NIC+0x04) /* Transmit Status */
#define WD_TRPG (WD_BASE+WD_NIC+0x04) /* Transmit Page */
#define WD_TB0 (WD_BASE+WD_NIC+0x05) /* Transmit byte count, low */
#define WD_TB1 (WD_BASE+WD_NIC+0x06) /* Transmit byte count, high */
#define WD_ISR (WD_BASE+WD_NIC+0x07) /* Interrupt status register */
#define WD_RBY0 (WD_BASE+WD_NIC+0x0a) /* remote byte count low. */
#define WD_RBY1 (WD_BASE+WD_NIC+0x0b) /* remote byte count high. */
#define WD_RCC (WD_BASE+WD_NIC+0x0c) /* receive configuration */
#define WD_TRC (WD_BASE+WD_NIC+0x0d) /* transmit configuration */
#define WD_DCR (WD_BASE+WD_NIC+0x0e) /* data configuration */
#define WD_IMR (WD_BASE+WD_NIC+0x0f) /* Interrupt Mask register. */
#define WD_PAR0 (WD_BASE+WD_NIC+0x01)
#define WD_CUR (WD_BASE+WD_NIC+0x07)
#define WD_MAR0 (WD_BASE+WD_NIC+0x08)

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,150 @@
CHANGES IN THE LINUX v0.97 ROOT DISKETTE
Jim Winstead Jr. - 4 August 1992
This file mostly contains info about the changes in the root diskette
from Linux v0.96 to Linux v0.97.
BUGS
'mount' is broken in strange ways, particularly in passing
options '-o whatever'. I'm working on this.
CHANGES
With the release of Linux v0.95a, the maintenance of the root diskette
has been assumed by Jim Winstead Jr. (jwinstea@jarthur.Claremont.EDU).
This continues with the release of the Linux 0.97 release diskette.
The changes between the Linux 0.97 and Linux 0.96 root diskettes are
detailed below, and the changes in earlier releases are summarized
after that:
- many small binaries were added, including:
cmp cut date env find head id install logname nice
nohup pathchk printenv printf sed setserial sort sum
tac tee tr tty uname uniq wall wc who whoami write yes
(Some of these may have been on previous root disks -
I don't have the motivation to double check that. In any
case, they are definitely on 0.97. :)
- ps, w, uptime, and related utilities were removed.
Because these programs rely very closely upon the
kernel being used, they can be outdated quite quickly.
- migrated mount/umount/swapon from /bin to /etc.
This conforms to common usage (only root can use these
programs), and current standards.
- moved 'rootdev' to /usr/bin and renamed to 'setroot'.
This reflects more common usage of the utility - it is no
longer needed for inserting the root device in /etc/mtab, but
it is still useful to change the root device of a kernel image.
- removed /lib/libhard.2.2.2 and moved /lib/libsoft.2.2.2 to
/lib/libm.2.2.2, instead of using a symlink.
- upgraded efdisk and renamed to fdisk.
efdisk was upgraded to v0.93, from Owen LeBlanc's MCC 0.96c
interim release, with some small changes from me to support the
-l flag, allowing it to completely replace fdisk.
- fixed compress to work with long filenames.
Previous versions of compress would refuse to compress files
with names longer than 12 characters - this was hardcoded in
the source the FSF makes available.
- brought device names up to standards.
Fixed some device names according to decisions made on
the Linux Standards discussion list, particularly
renaming /dev/lp* to /dev/par*, 'hard' /dev/fd*
devices, /dev/bm (bus mouse), and fixing the numbering
of /dev/ttys*.
- revised /etc/group.
/etc/group now contains only the 'standard' group names
discussed in the Linux Standards list. Of special note is the
renaming of the 'bin' group to 'obsolete'.
Using the 'bin' group as a means of identifying executables is
not recommended. That is what the executable bits are designed
to do.
- revised /etc/passed.
/etc/passwd was changed as a result of the new /etc/group, and
to eliminate unnecessary usernames - many groups were removed
because using uid != 0 for important files is a security hole
on NFS-mountable drives
- changes file permissions and ownerships.
This was done to reflect changes in /etc/group and /etc/passwd.
- fixed up the install script where it was broken.
All known major bugs were fixed. Particularly where /usr was
concerned.
- fixed the install documentation to refer to pax.
- minor gaffes from 0.96 fixed (/etc/getty linked with
shared libs, correct file ownerships, etc)
If you have questions, problems, or complaints about the root
diskette, either post to comp.os.linux, or send mail to me at
jwinstea@jarthur.Claremont.EDU.
If you have questions, problems, or complaints about the boot diskette
or the kernel itself, post to comp.os.linux or send mail to Linus
Torvalds at torvalds@cc.helsinki.fi.
Remember, the only stupid questions are the ones you don't ask.
SUMMARY
This section very briefly summarizes previous changes.
0.95a -> 0.96
- reintroduced GNU bash as /bin/sh
- replaced GNU tar (/bin/tar) with POSIX pax utility
- all-new and improved installation script
- split /etc/rc into /etc/rc and /etc/rc.local
- new mount/umount/swapon with auto-mounting - uses /etc/fstab
- recompiled all utilities with shared libraries (gcc 2.2.2)
- added /dev/MAKEDEV - device creation script
- all new /etc/termcap using "tc=con-unk" entries
FUTURE CHANGES
I'm already anticipating some changes for future releases, so here's
a sneak preview:
- the install script will be improved. The current one was
written rather rapidly, so there are parts of it I'm not
entirely happy with.
- I'd like to write an update script that will allow people who
have already installed Linux to update their binaries from the
latest root disk. The install script could serve as a base
for this, but is a little destructive at present. (It would
simply copy over old binaries, etc.)
- program to allow the 'intro' login to be more interactive, and
will also serve more general purposes (it will be a generic
curses-based file-selector with support for file descriptions).
- the documentation on disk will be cleaned up, and possibly
added to.
- fill in the gaps in the MAKEDEV script. (SCSI tapes, more pty
devices.)
- the release after the extended filesystem is added to the
Linux kernel, the root disk will use it. That means v0.98, if
things go according to current plans. This is to allow time
for bugs in the extended filesystem to filter out, and for the
new mkfs and fsck to stabilize. (For those that don't know,
the extended filesystem supports 4 terabyte partitions and long
filenames, and is currently in testing.)
Again, mail your questions, comments and suggestions about the root
diskette to me at jwinstea@jarthur.Claremont.EDU.

View File

@@ -0,0 +1,150 @@
CHANGES IN THE LINUX v0.97 ROOT DISKETTE
Jim Winstead Jr. - 4 August 1992
This file mostly contains info about the changes in the root diskette
from Linux v0.96 to Linux v0.97.
BUGS
'mount' is broken in strange ways, particularly in passing
options '-o whatever'. I'm working on this.
CHANGES
With the release of Linux v0.95a, the maintenance of the root diskette
has been assumed by Jim Winstead Jr. (jwinstea@jarthur.Claremont.EDU).
This continues with the release of the Linux 0.97 release diskette.
The changes between the Linux 0.97 and Linux 0.96 root diskettes are
detailed below, and the changes in earlier releases are summarized
after that:
- many small binaries were added, including:
cmp cut date env find head id install logname nice
nohup pathchk printenv printf sed setserial sort sum
tac tee tr tty uname uniq wall wc who whoami write yes
(Some of these may have been on previous root disks -
I don't have the motivation to double check that. In any
case, they are definitely on 0.97. :)
- ps, w, uptime, and related utilities were removed.
Because these programs rely very closely upon the
kernel being used, they can be outdated quite quickly.
- migrated mount/umount/swapon from /bin to /etc.
This conforms to common usage (only root can use these
programs), and current standards.
- moved 'rootdev' to /usr/bin and renamed to 'setroot'.
This reflects more common usage of the utility - it is no
longer needed for inserting the root device in /etc/mtab, but
it is still useful to change the root device of a kernel image.
- removed /lib/libhard.2.2.2 and moved /lib/libsoft.2.2.2 to
/lib/libm.2.2.2, instead of using a symlink.
- upgraded efdisk and renamed to fdisk.
efdisk was upgraded to v0.93, from Owen LeBlanc's MCC 0.96c
interim release, with some small changes from me to support the
-l flag, allowing it to completely replace fdisk.
- fixed compress to work with long filenames.
Previous versions of compress would refuse to compress files
with names longer than 12 characters - this was hardcoded in
the source the FSF makes available.
- brought device names up to standards.
Fixed some device names according to decisions made on
the Linux Standards discussion list, particularly
renaming /dev/lp* to /dev/par*, 'hard' /dev/fd*
devices, /dev/bm (bus mouse), and fixing the numbering
of /dev/ttys*.
- revised /etc/group.
/etc/group now contains only the 'standard' group names
discussed in the Linux Standards list. Of special note is the
renaming of the 'bin' group to 'obsolete'.
Using the 'bin' group as a means of identifying executables is
not recommended. That is what the executable bits are designed
to do.
- revised /etc/passed.
/etc/passwd was changed as a result of the new /etc/group, and
to eliminate unnecessary usernames - many groups were removed
because using uid != 0 for important files is a security hole
on NFS-mountable drives
- changes file permissions and ownerships.
This was done to reflect changes in /etc/group and /etc/passwd.
- fixed up the install script where it was broken.
All known major bugs were fixed. Particularly where /usr was
concerned.
- fixed the install documentation to refer to pax.
- minor gaffes from 0.96 fixed (/etc/getty linked with
shared libs, correct file ownerships, etc)
If you have questions, problems, or complaints about the root
diskette, either post to comp.os.linux, or send mail to me at
jwinstea@jarthur.Claremont.EDU.
If you have questions, problems, or complaints about the boot diskette
or the kernel itself, post to comp.os.linux or send mail to Linus
Torvalds at torvalds@cc.helsinki.fi.
Remember, the only stupid questions are the ones you don't ask.
SUMMARY
This section very briefly summarizes previous changes.
0.95a -> 0.96
- reintroduced GNU bash as /bin/sh
- replaced GNU tar (/bin/tar) with POSIX pax utility
- all-new and improved installation script
- split /etc/rc into /etc/rc and /etc/rc.local
- new mount/umount/swapon with auto-mounting - uses /etc/fstab
- recompiled all utilities with shared libraries (gcc 2.2.2)
- added /dev/MAKEDEV - device creation script
- all new /etc/termcap using "tc=con-unk" entries
FUTURE CHANGES
I'm already anticipating some changes for future releases, so here's
a sneak preview:
- the install script will be improved. The current one was
written rather rapidly, so there are parts of it I'm not
entirely happy with.
- I'd like to write an update script that will allow people who
have already installed Linux to update their binaries from the
latest root disk. The install script could serve as a base
for this, but is a little destructive at present. (It would
simply copy over old binaries, etc.)
- program to allow the 'intro' login to be more interactive, and
will also serve more general purposes (it will be a generic
curses-based file-selector with support for file descriptions).
- the documentation on disk will be cleaned up, and possibly
added to.
- fill in the gaps in the MAKEDEV script. (SCSI tapes, more pty
devices.)
- the release after the extended filesystem is added to the
Linux kernel, the root disk will use it. That means v0.98, if
things go according to current plans. This is to allow time
for bugs in the extended filesystem to filter out, and for the
new mkfs and fsck to stabilize. (For those that don't know,
the extended filesystem supports 4 terabyte partitions and long
filenames, and is currently in testing.)
Again, mail your questions, comments and suggestions about the root
diskette to me at jwinstea@jarthur.Claremont.EDU.

View File

@@ -0,0 +1,149 @@
CHANGES IN THE LINUX v0.97.1 ROOT DISKETTE
Jim Winstead Jr. - 16 August 1992
This file mostly contains info about the changes in the root diskette
from Linux v0.97 to Linux v0.97.1.
CHANGES
With the release of Linux v0.95a, the maintenance of the root diskette
has been assumed by Jim Winstead Jr. (jwinstea@jarthur.Claremont.EDU).
This continues with the release of the Linux 0.97.1 release diskette.
The changes between the Linux 0.97.1 and Linux 0.97 root diskettes are
detailed below, and the changes in earlier releases are summarized
after that:
- fixed mount.
A few hours after releasing 0.97, I figured out why
mount wasn't working correctly with the MS-DOS
filesystem. 'mount' now does things correctly, and
will even pass 'odd' mount options correctly (i.e. the
conv=something option for the MS-DOS fs). Thanks to
Werner Almesberger for providing smount, from which
most of my changes to Doug Quale's mount were taken.
- made passwd sgid system.
I forgot to last time, which made /etc/passwd belong to
whatever group the person who last changed their password
belonged to. Thanks to Scott Mace (emace@tenet.edu) for
spotting this one.
- fixed bug in /etc/termcap.
The 'is' and 'rs' strings had an extra colon in them,
and the k? strings were wrong. Special thanks to
Jaakko.Hyvatti@Helsinki.FI for pointing this out.
- fixed pax (some).
Pax was broken in a few spots, and I've been trying to
clean it up. In particular, it would give some false
errors because it would try to create some directories
twice. Duh. I'm also trying to bring it up to POSIX
compliance, since it's quite out of date.
- fixed problems with GNU fileutilities.
The GNU fileutilities (cp, du and ls in particular)
were making some bad assumptions about the blocksize
on filesystems. I think I've tracked that all down.
Also, fixed ls so it recognizes the dir and vdir
counterparts using argv[0] instead of seperate filenames.
I was also able to trim some size off a few utilities
due to functions available in libc.
- compiled GNU text utilities to use getopt/regex from libc.
I also fixed cat so you can use it with the various
options (like -v, etc). This saved over 30k. (Wow!)
- compiled GNU shell utilities to use getopt/regex from libc.
This saved another 30k. Wow again!
- compiled GNU tput to use termcap from shared libs.
A lot of the changes to be like this, don't they? :)
Saved about 4k here.
- compiled sed with -N.
Saved 6k. :)
- added creation of user account to /INSTALL/install.
The install script now asks for a username to create an
account for and sets it up. This should encourage not
using 'root' all the time.
If you have questions, problems, or complaints about the root
diskette, either post to comp.os.linux, or send mail to me at
jwinstea@jarthur.Claremont.EDU.
If you have questions, problems, or complaints about the boot diskette
or the kernel itself, post to comp.os.linux or send mail to Linus
Torvalds at torvalds@cc.helsinki.fi.
Remember, the only stupid questions are the ones you don't ask.
SUMMARY
This section very briefly summarizes previous changes.
0.96 -> 0.97
- many small binaries were added.
- ps, w, uptime, and related utilities were removed.
- migrated mount/umount/swapon from /bin to /etc.
- moved 'rootdev' to /usr/bin and renamed to 'setroot'.
- removed /lib/libhard.2.2.2 and moved /lib/libsoft.2.2.2 to
/lib/libm.2.2.2, instead of using a symlink.
- upgraded efdisk and renamed to fdisk.
- fixed compress to work with long filenames.
- brought device names up to standards.
- revised /etc/group.
- revised /etc/passed.
- changes file permissions and ownerships.
- fixed up the install script where it was broken.
- fixed the install documentation to refer to pax.
- minor gaffes from 0.96 fixed (/etc/getty linked with shared
libs, correct file ownerships, etc)
0.95a -> 0.96
- reintroduced GNU bash as /bin/sh
- replaced GNU tar (/bin/tar) with POSIX pax utility
- all-new and improved installation script
- split /etc/rc into /etc/rc and /etc/rc.local
- new mount/umount/swapon with auto-mounting - uses /etc/fstab
- recompiled all utilities with shared libraries (gcc 2.2.2)
- added /dev/MAKEDEV - device creation script
- all new /etc/termcap using "tc=con-unk" entries
FUTURE CHANGES
I'm already anticipating some changes for future releases, so here's
a sneak preview:
- the install script will be improved. The current one was
written rather rapidly, so there are parts of it I'm not
entirely happy with. Michael K. Johnson (johnsonm@stolaf.edu)
has said he is working on this and the update script (below).
- I'd like to write an update script that will allow people who
have already installed Linux to update their binaries from the
latest root disk. The install script could serve as a base
for this, but is a little destructive at present. (It would
simply copy over old binaries, etc.)
- program to allow the 'intro' login to be more interactive, and
will also serve more general purposes (it will be a generic
curses-based file-selector with support for file descriptions).
- the documentation on disk will be cleaned up, and possibly
added to.
- fill in the gaps in the MAKEDEV script. (SCSI tapes, more pty
devices.)
- the release after the extended filesystem is added to the
Linux kernel, the root disk will use it. That means v0.98, if
things go according to current plans. This is to allow time
for bugs in the extended filesystem to filter out, and for the
new mkfs and fsck to stabilize. (For those that don't know,
the extended filesystem supports 4 terabyte partitions and long
filenames, and is currently in testing.)
Again, mail your questions, comments and suggestions about the root
diskette to me at jwinstea@jarthur.Claremont.EDU.

View File

@@ -0,0 +1,124 @@
INSTALL NOTES FOR LINUX v0.97
Jim Winstead Jr. - 4 August 1992
This file contains basic instructions for installing Linux v0.97.
More detailed instructions have been written by others. Read the
Linux FAQ for some suggestions, and for pointers to other installation
documents.
COPYRIGHT
Linux 0.97 is NOT public domain software, but is copyrighted by Linus
Torvalds (torvalds@cc.helsinki.fi). The copyright terms follow the
GNU Copyleft. See the file COPYING from any GNU software package for
the finer points. Note that the unistd library functions and all
library functions written by Linus Torvalds are exempt from this
copyright, and you may use them as you wish.
WARNING
The 0.97 root disk requires the 0.96b or later kernel, although
the 0.97 kernel is strongly recommended. A bootable image of this
kernel should be available where you got the image for the 0.97
root disk.
INSTALLATION
1) First, and absolutely the most important step, MAKE BACKUPS OF YOUR
SYSTEM! This system won't do anything nearly as nasty as coredump all
over your harddrive (see 386BSD v0.0), but it is quite easy to
accidently screw something up while installing.
2) Test out the Linux v0.97 boot disk with the Linux v0.97 root
disk. If you are unable to get the boot disk to work properly on
your system, try posting to comp.os.linux, or contacting Linus.
Notice that Linux (as of v0.95) contains an init/getty/login suite,
and this will start up 'login' on the first four virtual consoles,
accessed by Left-Alt-F[1234]. If you experience problems on one
virtual console, it should be possible to switch to another one.
3) login as 'install', and the system will walk you through the
process of installing Linux on a hard drive partition. The
process is fairly automated, but the process requires that you go
through the steps of creating a partition for Linux usage. Some
tips follow:
Read the efdisk file from the intro login, which will explain
the basic concepts of hard disk partitions, and how to use
efdisk.
You may find it useful to login to one virtual console as
intro, so you can access the on-disk documentation, and
another as install, so you can do the installation and easy
access the documentation.
The maximum size of a Minix filesystem (the type created by
mkfs) is 64 megabytes. This is not a limitation of mkfs or
Linux, but a limitation of the Minix filesystem that is used.
With the release of Linux v0.97, a new 'extended' filesystem
has been released that supports 4 terabyte (!) partitions,
and extended filenames. The root disk does not contain
utilities to use this extended filesystem, however, because
the filesystem is still consider alpha code.
4) You should now have a complete (but very basic) root filesystem on
your harddrive. To be able to boot from floppy with this as your
root filesystem, you will have to edit the boot diskette. This is
done by modifying the word at offset 508 (decimal) with a program
such as Norton's Disk Editor, or use pboot.exe (available where
you got this file, the boot disk and the root disk, hopefully.)
This word is in 386-order (that is, least-significant byte first),
which means it should look like one of the following:
LSB MSB - device
--------------------------
01 03 - /dev/hda1 LSB = Least-Significant Byte
02 03 - /dev/hda2 MSB = Most-Significant Byte
03 03 - /dev/hda3
04 03 - /dev/hda4
41 03 - /dev/hdb1
42 03 - /dev/hdb2
43 03 - /dev/hdb3
44 03 - /dev/hdb4
The numbers are in hex, and if you're editing the boot diskette by
hand, these two bytes should initially be 00 00 (and are followed
by two non-zero bytes).
Note that pboot.exe predates Linux 0.95a, so some of the
information it presents is inaccurate (it refers to the old hd*
naming scheme). The codes to use are as above, but with the most-
significant byte first. (So /dev/hda1 = 0301, /dev/hda2 = 0302,
etc.)
5) You should now be able to boot from this diskette and it will use
your new Linux partition as the root partition. You'll notice,
however, that you can't do a whole lot with just the programs on
the root diskette. You'll need to get further packages from
whereever you got the root and boot diskettes, and read these from
a floppy using pax and compress.
(Simple instructions: Download the file to DOS, use rawrite to write
the tar file to diskette. Use 'dd if=/dev/fd[01] | uncompress | pax
-rv' to read the file from floppy, where /dev/fd0 is your first
floppy drive (A: under DOS), and /dev/fd1 is your second floppy drive
(B: under DOS).
6) To reboot your machine when running Linux, you should use the
'reboot' command. This makes sure to flush all caches to disk,
and notifies other users that the system is going down (well, the
last bit isn't real important).
FAILURE TO DO THIS COULD RESULT IN BADLY CORRUPTED FILESYSTEMS.
----------------------------------------------------------------------------
These instructions are not the best, but should be enough to get you
going. If you have more questions, either post on comp.os.linux, or
send mail to me (jwinstea@jarthur.Claremont.EDU), or to Linus
(torvalds@cc.helsinki.fi). Remember, the only stupid questions are
the ones that you don't ask.

View File

@@ -0,0 +1,75 @@
Changes in 0.97:
- The VESA-support was removed. I'd be happy to put it back once it
works on all hardware. Instead of the VESA-code, I finally put in
the automatic SVGA setup patches. See the top-level Makefile.
- The IRQ code has solidified, and should work on all machines. Not
all of the SCSI drivers use it yet, so I expect patches for that..
- Serial interrupts are handled slightly differently, and performance
should be up. I've sent out a few alpha-releases, and testing seems
to indicate that's actually true this time. Reactions have ranged
from "nice" to "wonderful" :-)
- The buffer-cache and memory management code has been edited quite a
bit. ps/free etc programs that reads kernel memory directly no
longer work, and even a recompilation won't be enough. They actually
need editing before they work.
The buffer-cache now grows and shrinks dynamically depending on how
much free memory there is. Shift+PrintScreen will give some memory
statistics. (Ctrl+PrSc gives task-info, ALT+PrSc gives current
register values).
The mm code changes removed some race-conditions in the VM code, and
I also tried to make the Out-of-swapspace error less severe (better
thrashing-detection etc).
- The super-block code has been cleaned up. Especially the extended fs
needs to be edited a bit to take advantage of the new setup, and I
expect Remy Card will have a patch out eventually.
- include-files have been moved around some more: there are still some
names that clash with the standard headers, but not many.
- Unswappable processes implemented: by default only 'init' is
unswappable. This is a bit safer in low-memory conditions, as at
least init won't die due to low memory. I also made killing init
impossible: if init doesn't recognize a signal, it simply won't get
it. Some other changes ("while (1) fork();" won't kill the machine
for non-root users etc)
- The new SCSI drivers are in. These make the kernel noticeably
bigger, but you can leave them out if you don't want them.
- The floppy- and hd-drivers print out more debugging-info in case of
errors: this might be irritating if you have hardware that works, but
often gives soft-errors. On the other hand, some old debugging-info
was removed - notably for user-level protection errors etc.
- Various minor fixes. I haven't made cdiffs (and I haven't gotten any
requests for them, so I probably never will), but they would be
pretty big.
Things that I didn't have time for:
- I wanted to rewrite the tty drivers to be more "streams-like" (ie not
an actual streams-implementation, but some of the ideas from
streams). I never got around to it: there was simply too much else
to do.
- I got a lot of patches, and some went in, others didn't. If you
think your patch was important, please re-send it relative to the new
version.
I'd like comments on the new system: performance / clarity of code etc.
0.97 should correct all known bugs (at least the ones I know about), but
I guess that's just wishful thinking.
Note that the dynamic buffer-code also handles differently-sized
buffers, but that the rest of the system (block device drivers,
filesystem code etc) cannot yet take advantage of this - there is still
some coding needed.
Linus

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,41 @@
----------------------- LARIX -----------------------------------
Larix means "Load And Run In Kernel Space". It allows dynamic
additions to the kernel. As an example I've edited the bus mouse
driver and the MSDOS filesystem to be loaded in this way.
If Linus likes it enough to include into the standard kernel,
I'll rewrite all other devices too. This way if you are working
on a device driver, you can simply unload the standard device
driver, and load your own. No more kernel relinking, no more
reboots.
This is the first version that is going out on the net. I probably
forgot some file, so the first to report that a file is missing is
offered a fee update ! :-)
The file is packaged as a context diff, which you can apply to
your linux 0.97 pl4 kernel by typing something like
zcat larix.diffs.Z |patch -p0
in the /usr/src directory. (as always, make a backup of the
original, in case something goes wrong.)
This package also uses a general purpose kernel malloc routine.
So your device drivers may use those too if they need them.
Do note that the "users" of this kernel malloc routine are responsible
for preventing fragmentation. So don't allocate very many very small
blocks of memory unless you intend to free them all at once.
Bugs, bug fixes, and questions may be directed to me:
email: wolff@duteca.et.tudelft.nl.
or: Roger Wolff
Oosterstraat 23
2611 TT Delft
Holland
Tel ()31-15-142371
Roger.

View File

@@ -0,0 +1,22 @@
Larix - Load and run in kernel space.
Suggested for all working on device drivers or filesystems.
This is also helpful for people who are working on modifying one
specific system call.
This can be considered as an alpha testing release, although I'm more
or less finished with it. (i.e. I'd put it in a alpha testing directory)
The file contains manuals.
Bugs, questions etc. can be sent to me:
wolff@dutecai.et.tudelft.nl,
Roger Wolff
Oosterstraat 23
2611 TT Delft
Holland.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,201 @@
ANNOUNCING - CDROM support for linux (beta 0.2).
CDROM support for linux is now ready for beta testing. You
must have a CDROM drive, a SCSI adapter and a ISO9660 format disc
before this will be of any use to you. You will also need to have the
source tree for linux 0.97 kernel sources available. This will work with
either 0.97 or 0.97pl1, but pl1 is probably better mainly because it handles
memory better (unrelated to the CDROM, but still an important point).
This project was a team effort. The SCSI work was done by
David Giller rafetmad@cheshire.oxy.edu, and the filesystem was written
by Eric Youngdale eric@tantalus.nrl.navy.mil. So far, the code has been
tested with an aha1542 SCSI card and both NEC and Sony CDROM drives.
A number of different discs have been tested.
To install, unpack the archive in your linux kernel directory
(usually /usr/src. This will add a number of new files to the linux
source tree). You will then need to apply the patches found in cdrom.diff
with the following command:
patch -p0 < cdrom.diff
and then build the kernel. Once you have booted the system, you will need
to add a device with major=11, minor=0 for the first cdrom drive, minor=1 for
the second and so forth. You can use a command something like:
mknod -m 500 /dev/cdrom b 11 0
To mount a disc, use a command something like:
mount -t iso9660 /dev/cdrom /mnt
I would be interested in hearing about any successes or failures with this
code.
CHANGES SINCE 0.1:
Error detection/correction have been improved. You should not
get any more multiply queued commands, and I increased the timeout
period such that the drive no longer times out. My drive is fairly
fast, so other drives may have timeout problems. I need to know this
so that I can increase the timeout period to a workable value for all
drives. The error detection/correction should be pretty solid now.
Support for Rock Ridge extensions has been added to the filesystem.
This means:
* Longer filenames (My implementation limits it to 256 chars).
* Mixed case filenames, Normal unix syntax availible.
* Files have correct modes, number of links, and uid/gid
* Separate times for atime, mtime, and ctime.
* Symbolic links.
* Block and Character devices (Untested).
* Deep directories (Untested).
I was able to implement this because Adam Richter was kind
enough to lend me the Andrew Toolkit disc, which has the Rock Ridge
extensions. I should point out that the block and character devices
and the deep directories have not been tested, since they do not
appear on the disc that I have. If anyone has some pre-mastering software,
and could throw together a *very* small volume (i.e. one floppy disc)
that has some of these things, I could use the floppy to test and debug
these features.
A single element cache was added that sits between the readdir
function and the lookup function. Many programs that traverse the
directory tree (i.e. ls) also need to know the inode number and find
information about the file from the inode table. For the CDROM this
is kind of silly, since all of the information is in one place, but we
have to make it look kind of like unix. Thus the readdir function
returns a name, and then we do a stat, given that name and have to
search the same directory again for the file that we just extracted in
readdir. On the Andrew toolkit disc, there is one directory that
contains about 700 files and is nearly 80kb long - doing an ls -l in
that directory takes several minutes, because each lookup has to
search the directory. Since it turns out that we often call lookup
just after we read the directory, I added a one element cache to save
enough information so as to eliminate the need to search the directory
again.
Scatter-gather for the cdrom is now enabled. This should lead
to slightly faster I/O.
KNOWN PROBLEMS:
None.
********************************************
Some general comments are in order:
On some drives, there is a feature where the drive can be
locked under software control to essentially deactivate the eject
button. The iso9660 filesystem activates this feature on drives so
equipt, so you may be unable to remove the disc while it is mounted.
The eject button will be re-enabled once the disc is dismounted.
Since it is impossible to corrupt a CDROM, it is unlikely that
a bug in the iso9660 filesystem will lead to data corruption on your
hard disk, with the possible exception of files copied from the CDROM
to the hard disk. Nonetheless, it is a good idea to have a backup or
your hard disk, just in case. Then again, I really did not need to
say that, did I :-)
There were several bugs in error handling in the scsi code.
Previously when a command failed, the higher level drivers would not
receive the correct sense data from the failed command, or would misinterpret
the data that they did get. These has been fixed.
Up until now, SCSI devices were either discs or tapes (and the
tapes have not been fully implemented). CDROM drives are now a third
category. There are several reasons why we do not want to treat then
the same as a regular hard disk, and it was cleaner to make a third
type of device. One reason was that.....
The CDROM has a sector size of 2048 bytes, but the buffer
cache has buffer sizes of 1024 bytes. The SCSI high level driver for
the cdrom must perform buffering of all of the I/O in order to satisfy
the request. At some point in the near future support will be present
in the kernel for buffers in the buffer cache which are != 1024 bytes,
at which time this code will be remove.
Only the ISO 9660 filesystem is supported. High Sierra is not
supported. The High Sierra format is just an earlier version of
ISO9660, but there are minor differences between the two. Sometimes
people use the two names interchangably, but nearly all newer discs
are the ISO9660 format. It would not be that difficult to support HS,
but I doubt that there are very many HS discs are out there. I will
add this if there is demand for it.
The inode numbers for files are essentially just the byte
offset of the beginning of the directory record from the start of the
disc. A disc can only hold about 660 MB, so the inode numbers will
be somewhere between about 60K and 660M. Any tool that performs
a stat() on the CDROM obviously needs to be recompiled if it was
compiled before 32 bit inode support was in the kernel.
A number of ioctl functions have been provided, some of which
are only of use when trying to play an audio disc. An attempt has
been made to make the ioctls compatible with the ioctls on a Sun, but
we have been unable to get any of the audio functions to work. My
NEC drive and David's Sony reject all of these commands, and we currently
believe that both of these drives implement the audio functions using
vendor-specific command codes rather than the universal ones specified
in the SCSI-II specifications.
The filesystem has been tested under a number of conditions,
and has proved to be quite reliable so far. This filesystem is
considerably simpler than a read/write filesystem (Files are
contiguous, so no file allocation tables need to be maintained, there
is no free space map, and we do not need to know how to rename, create
or delete files).
Text files on a CDROM can have several types of line
terminators. Lines can be terminated by LF, CRLF, or a CR. The
filesystem scans the first 1024 bytes of the file, searching for out
of band characters (i.e. > 0x80 or some control characters), and if it
finds these it assumes the the file is a binary format. If there are
no out of band characters the filesystem will assume that the file is
a text file (keeping track of whether the lines are terminated by a
CR, CRLF, or LF), and automatically converts the line terminators to a
LF, which is the unix standard. In the case of CRLF termination, the
CR is converted to a ' '.
***************************************
***************************************
The remaining comments *only* apply to discs *without* the Rock Ridge
extensions:
The find command does not work without the -noleaf switch.
The reason for this is that the number of links for each directory file
is not easily obtainable, so it is set to 2. The default behavior for
the find program is to look for (i_links-2) subdirectories in each
directory, and it then assumes that the rest are regular files. The
-noleaf switch disables this optimization.
The filesystem currently has the execute permission set for
any non-directory file that does not have a period in its name. This
is a crude assumption for now, but it kind of works. There is not an
easy way of telling whether a file should be executable or not.
Theoretically it is possible to read the file itself and check for a
magic number, but this would considerably degrade performance.
The filesystem does not support block or character devices,
fifos, or symbolic links. Also, the setuid bit is never set for any
program. The main reason for this is that there is no information in
the directory entry itself which could be used to indicate these
special types of files.
Filenames under ISO9660 are normally all upper case on the
disc but the filesystem maps these to all lower case. The filenames
on the disc also have a version number (like VMS) which appears at the
end of the filename, and is separated from the rest of the filename by
a ';' character. The filesystem strips the version numbers from the
filename if the version number is 1, and replaces the ';' by a '.' if
the version number is >1.
eric@tantalus.nrl.navy.mil

View File

@@ -0,0 +1,201 @@
ANNOUNCING - CDROM support for linux (beta 0.2).
CDROM support for linux is now ready for beta testing. You
must have a CDROM drive, a SCSI adapter and a ISO9660 format disc
before this will be of any use to you. You will also need to have the
source tree for linux 0.97 kernel sources available. This will work with
either 0.97 or 0.97pl1, but pl1 is probably better mainly because it handles
memory better (unrelated to the CDROM, but still an important point).
This project was a team effort. The SCSI work was done by
David Giller rafetmad@cheshire.oxy.edu, and the filesystem was written
by Eric Youngdale eric@tantalus.nrl.navy.mil. So far, the code has been
tested with an aha1542 SCSI card and both NEC and Sony CDROM drives.
A number of different discs have been tested.
To install, unpack the archive in your linux kernel directory
(usually /usr/src. This will add a number of new files to the linux
source tree). You will then need to apply the patches found in cdrom.diff
with the following command:
patch -p0 < cdrom.diff
and then build the kernel. Once you have booted the system, you will need
to add a device with major=11, minor=0 for the first cdrom drive, minor=1 for
the second and so forth. You can use a command something like:
mknod -m 500 /dev/cdrom b 11 0
To mount a disc, use a command something like:
mount -t iso9660 /dev/cdrom /mnt
I would be interested in hearing about any successes or failures with this
code.
CHANGES SINCE 0.1:
Error detection/correction have been improved. You should not
get any more multiply queued commands, and I increased the timeout
period such that the drive no longer times out. My drive is fairly
fast, so other drives may have timeout problems. I need to know this
so that I can increase the timeout period to a workable value for all
drives. The error detection/correction should be pretty solid now.
Support for Rock Ridge extensions has been added to the filesystem.
This means:
* Longer filenames (My implementation limits it to 256 chars).
* Mixed case filenames, Normal unix syntax availible.
* Files have correct modes, number of links, and uid/gid
* Separate times for atime, mtime, and ctime.
* Symbolic links.
* Block and Character devices (Untested).
* Deep directories (Untested).
I was able to implement this because Adam Richter was kind
enough to lend me the Andrew Toolkit disc, which has the Rock Ridge
extensions. I should point out that the block and character devices
and the deep directories have not been tested, since they do not
appear on the disc that I have. If anyone has some pre-mastering software,
and could throw together a *very* small volume (i.e. one floppy disc)
that has some of these things, I could use the floppy to test and debug
these features.
A single element cache was added that sits between the readdir
function and the lookup function. Many programs that traverse the
directory tree (i.e. ls) also need to know the inode number and find
information about the file from the inode table. For the CDROM this
is kind of silly, since all of the information is in one place, but we
have to make it look kind of like unix. Thus the readdir function
returns a name, and then we do a stat, given that name and have to
search the same directory again for the file that we just extracted in
readdir. On the Andrew toolkit disc, there is one directory that
contains about 700 files and is nearly 80kb long - doing an ls -l in
that directory takes several minutes, because each lookup has to
search the directory. Since it turns out that we often call lookup
just after we read the directory, I added a one element cache to save
enough information so as to eliminate the need to search the directory
again.
Scatter-gather for the cdrom is now enabled. This should lead
to slightly faster I/O.
KNOWN PROBLEMS:
None.
********************************************
Some general comments are in order:
On some drives, there is a feature where the drive can be
locked under software control to essentially deactivate the eject
button. The iso9660 filesystem activates this feature on drives so
equipt, so you may be unable to remove the disc while it is mounted.
The eject button will be re-enabled once the disc is dismounted.
Since it is impossible to corrupt a CDROM, it is unlikely that
a bug in the iso9660 filesystem will lead to data corruption on your
hard disk, with the possible exception of files copied from the CDROM
to the hard disk. Nonetheless, it is a good idea to have a backup or
your hard disk, just in case. Then again, I really did not need to
say that, did I :-)
There were several bugs in error handling in the scsi code.
Previously when a command failed, the higher level drivers would not
receive the correct sense data from the failed command, or would misinterpret
the data that they did get. These has been fixed.
Up until now, SCSI devices were either discs or tapes (and the
tapes have not been fully implemented). CDROM drives are now a third
category. There are several reasons why we do not want to treat then
the same as a regular hard disk, and it was cleaner to make a third
type of device. One reason was that.....
The CDROM has a sector size of 2048 bytes, but the buffer
cache has buffer sizes of 1024 bytes. The SCSI high level driver for
the cdrom must perform buffering of all of the I/O in order to satisfy
the request. At some point in the near future support will be present
in the kernel for buffers in the buffer cache which are != 1024 bytes,
at which time this code will be remove.
Only the ISO 9660 filesystem is supported. High Sierra is not
supported. The High Sierra format is just an earlier version of
ISO9660, but there are minor differences between the two. Sometimes
people use the two names interchangably, but nearly all newer discs
are the ISO9660 format. It would not be that difficult to support HS,
but I doubt that there are very many HS discs are out there. I will
add this if there is demand for it.
The inode numbers for files are essentially just the byte
offset of the beginning of the directory record from the start of the
disc. A disc can only hold about 660 MB, so the inode numbers will
be somewhere between about 60K and 660M. Any tool that performs
a stat() on the CDROM obviously needs to be recompiled if it was
compiled before 32 bit inode support was in the kernel.
A number of ioctl functions have been provided, some of which
are only of use when trying to play an audio disc. An attempt has
been made to make the ioctls compatible with the ioctls on a Sun, but
we have been unable to get any of the audio functions to work. My
NEC drive and David's Sony reject all of these commands, and we currently
believe that both of these drives implement the audio functions using
vendor-specific command codes rather than the universal ones specified
in the SCSI-II specifications.
The filesystem has been tested under a number of conditions,
and has proved to be quite reliable so far. This filesystem is
considerably simpler than a read/write filesystem (Files are
contiguous, so no file allocation tables need to be maintained, there
is no free space map, and we do not need to know how to rename, create
or delete files).
Text files on a CDROM can have several types of line
terminators. Lines can be terminated by LF, CRLF, or a CR. The
filesystem scans the first 1024 bytes of the file, searching for out
of band characters (i.e. > 0x80 or some control characters), and if it
finds these it assumes the the file is a binary format. If there are
no out of band characters the filesystem will assume that the file is
a text file (keeping track of whether the lines are terminated by a
CR, CRLF, or LF), and automatically converts the line terminators to a
LF, which is the unix standard. In the case of CRLF termination, the
CR is converted to a ' '.
***************************************
***************************************
The remaining comments *only* apply to discs *without* the Rock Ridge
extensions:
The find command does not work without the -noleaf switch.
The reason for this is that the number of links for each directory file
is not easily obtainable, so it is set to 2. The default behavior for
the find program is to look for (i_links-2) subdirectories in each
directory, and it then assumes that the rest are regular files. The
-noleaf switch disables this optimization.
The filesystem currently has the execute permission set for
any non-directory file that does not have a period in its name. This
is a crude assumption for now, but it kind of works. There is not an
easy way of telling whether a file should be executable or not.
Theoretically it is possible to read the file itself and check for a
magic number, but this would considerably degrade performance.
The filesystem does not support block or character devices,
fifos, or symbolic links. Also, the setuid bit is never set for any
program. The main reason for this is that there is no information in
the directory entry itself which could be used to indicate these
special types of files.
Filenames under ISO9660 are normally all upper case on the
disc but the filesystem maps these to all lower case. The filenames
on the disc also have a version number (like VMS) which appears at the
end of the filename, and is separated from the rest of the filename by
a ';' character. The filesystem strips the version numbers from the
filename if the version number is 1, and replaces the ';' by a '.' if
the version number is >1.
eric@tantalus.nrl.navy.mil

View File

@@ -0,0 +1,243 @@
ANNOUNCING - CDROM support for linux (beta 0.5).
CDROM support for linux is now ready for beta testing. You
must have a CDROM drive, a SCSI adapter and a ISO9660 format disc
before this will be of any use to you. You will also need to have the
source tree for linux 0.97, patch level 5 kernel sources available.
With the patch level 5 kernel, the scsi cdrom support is now in the
distribution, so there are no longer any special scsi patches for the
cdrom. The filesystem is not yet a part of the kernel because it is eventually
envisioned (by Linus) that this will be installable at run time once the
installable driver/filesystem code is working in the kernel.
To install, unpack the archive in your linux kernel directory
(usually /usr/src. This will add a number of new files to the linux
source tree). You will then need to apply the patches found in cdrom.diff
with the following command:
patch -p0 < cdrom.diff
and then build the kernel. Once you have booted the system, you will need
to add a device with major=11, minor=0 for the first cdrom drive, minor=1 for
the second and so forth. You can use a command something like:
mknod -m 500 /dev/cdrom b 11 0
To mount a disc, use a command something like:
mount -t iso9660 /dev/cdrom /mnt
I would be interested in hearing about any successes or failures with this
code.
CHANGES SINCE 0.4:
No functional changes to filesystem, scsi code is now part of
distribution kernel as of pl5.
CHANGES SINCE 0.3:
The main difference is that the filesystem has been updated to
work with 0.97pl4.
Also, one new mount option has been added, "norock", which will
inhibit the rock ridge protocol.
CHANGES SINCE 0.2:
Support has been added for the older (and now obsolete) variant
of the iso9660 filesystem, which is known as High Sierra. There are apparently
a number of discs still out there that are in this format, and High Sierra
is actually nearly identical to iso9660, so I added support.
Mount options have been added which can disable filename mapping,
and control the conversion of text files. The options are
map=off
map=normal
conv=binary
conv=text
conv=mtext
The effect that these options have is described later on in this document.
One small scsi error was fixed which would result in the driver
hanging if there were an unusual error of any kind.
CHANGES SINCE 0.1:
Error detection/correction have been improved. You should not
get any more multiply queued commands, and I increased the timeout
period such that the drive no longer times out. My drive is fairly
fast, so other drives may have timeout problems. I need to know this
so that I can increase the timeout period to a workable value for all
drives. The error detection/correction should be pretty solid now.
Support for Rock Ridge extensions has been added to the filesystem.
This means:
* Longer filenames (My implementation limits it to 256 chars).
* Mixed case filenames, Normal unix syntax availible.
* Files have correct modes, number of links, and uid/gid
* Separate times for atime, mtime, and ctime.
* Symbolic links.
* Block and Character devices (Untested).
* Deep directories (Untested).
I was able to implement this because Adam Richter was kind
enough to lend me the Andrew Toolkit disc, which has the Rock Ridge
extensions. I should point out that the block and character devices
and the deep directories have not been tested, since they do not
appear on the disc that I have. If anyone has some pre-mastering software,
and could throw together a *very* small volume (i.e. one floppy disc)
that has some of these things, I could use the floppy to test and debug
these features.
A single element cache was added that sits between the readdir
function and the lookup function. Many programs that traverse the
directory tree (i.e. ls) also need to know the inode number and find
information about the file from the inode table. For the CDROM this
is kind of silly, since all of the information is in one place, but we
have to make it look kind of like unix. Thus the readdir function
returns a name, and then we do a stat, given that name and have to
search the same directory again for the file that we just extracted in
readdir. On the Andrew toolkit disc, there is one directory that
contains about 700 files and is nearly 80kb long - doing an ls -l in
that directory takes several minutes, because each lookup has to
search the directory. Since it turns out that we often call lookup
just after we read the directory, I added a one element cache to save
enough information so as to eliminate the need to search the directory
again.
Scatter-gather for the cdrom is now enabled. This should lead
to slightly faster I/O.
KNOWN PROBLEMS:
None.
********************************************
Some general comments are in order:
On some drives, there is a feature where the drive can be
locked under software control to essentially deactivate the eject
button. The iso9660 filesystem activates this feature on drives so
equipt, so you may be unable to remove the disc while it is mounted.
The eject button will be re-enabled once the disc is dismounted.
Since it is impossible to corrupt a CDROM, it is unlikely that
a bug in the iso9660 filesystem will lead to data corruption on your
hard disk, with the possible exception of files copied from the CDROM
to the hard disk. Nonetheless, it is a good idea to have a backup or
your hard disk, just in case. Then again, I really did not need to
say that, did I :-)
There were several bugs in error handling in the scsi code.
Previously when a command failed, the higher level drivers would not
receive the correct sense data from the failed command, or would misinterpret
the data that they did get. These has been fixed.
Up until now, SCSI devices were either discs or tapes (and the
tapes have not been fully implemented). CDROM drives are now a third
category. There are several reasons why we do not want to treat then
the same as a regular hard disk, and it was cleaner to make a third
type of device. One reason was that.....
The CDROM has a sector size of 2048 bytes, but the buffer
cache has buffer sizes of 1024 bytes. The SCSI high level driver for
the cdrom must perform buffering of all of the I/O in order to satisfy
the request. At some point in the near future support will be present
in the kernel for buffers in the buffer cache which are != 1024 bytes,
at which time this code will be remove.
Both the ISO 9660 filesystem and the High Sierra are
supported. The High Sierra format is just an earlier version of
ISO9660, but there are minor differences between the two. Sometimes
people use the two names interchangably, but nearly all newer discs
are the ISO9660 format.
The inode numbers for files are essentially just the byte
offset of the beginning of the directory record from the start of the
disc. A disc can only hold about 660 MB, so the inode numbers will
be somewhere between about 60K and 660M. Any tool that performs
a stat() on the CDROM obviously needs to be recompiled if it was
compiled before 32 bit inode support was in the kernel.
A number of ioctl functions have been provided, some of which
are only of use when trying to play an audio disc. An attempt has
been made to make the ioctls compatible with the ioctls on a Sun, but
we have been unable to get any of the audio functions to work. My
NEC drive and David's Sony reject all of these commands, and we currently
believe that both of these drives implement the audio functions using
vendor-specific command codes rather than the universal ones specified
in the SCSI-II specifications.
The filesystem has been tested under a number of conditions,
and has proved to be quite reliable so far. This filesystem is
considerably simpler than a read/write filesystem (Files are
contiguous, so no file allocation tables need to be maintained, there
is no free space map, and we do not need to know how to rename, create
or delete files).
Text files on a CDROM can have several types of line
terminators. Lines can be terminated by LF, CRLF, or a CR. The
filesystem scans the first 1024 bytes of the file, searching for out
of band characters (i.e. > 0x80 or some control characters), and if it
finds these it assumes the the file is a binary format. If there are
no out of band characters the filesystem will assume that the file is
a text file (keeping track of whether the lines are terminated by a
CR, CRLF, or LF), and automatically converts the line terminators to a
LF, which is the unix standard. In the case of CRLF termination, the
CR is converted to a ' '. The heuristic can be explicitly overridden
with the conv= mount option, which tells the filesystem that *all* files
on the volume are the specified type.
Rock Ridge extensions can be inhibited with the "norock" mount
option. This could be of use if you have scripts that work with the
non-Rock Ridge filenames, or if you encounter a bug in the filesystem
which really screws you up.
***************************************
***************************************
The remaining comments *only* apply to discs *without* the Rock Ridge
extensions:
The find command does not work without the -noleaf switch.
The reason for this is that the number of links for each directory file
is not easily obtainable, so it is set to 2. The default behavior for
the find program is to look for (i_links-2) subdirectories in each
directory, and it then assumes that the rest are regular files. The
-noleaf switch disables this optimization.
The filesystem currently has the execute permission set for
any non-directory file that does not have a period in its name. This
is a crude assumption for now, but it kind of works. There is not an
easy way of telling whether a file should be executable or not.
Theoretically it is possible to read the file itself and check for a
magic number, but this would considerably degrade performance.
The filesystem does not support block or character devices,
fifos, or symbolic links. Also, the setuid bit is never set for any
program. The main reason for this is that there is no information in
the directory entry itself which could be used to indicate these
special types of files.
Filenames under ISO9660 are normally all upper case on the
disc but the filesystem maps these to all lower case. The filenames
on the disc also have a version number (like VMS) which appears at the
end of the filename, and is separated from the rest of the filename by
a ';' character. The filesystem strips the version numbers from the
filename if the version number is 1, and replaces the ';' by a '.' if
the version number is >1. The mount option map=off will disable all
of the name mapping, and when this is in effect, all filenames will be
in upper case, and the semicolons and version numbers will always appear.
eric@tantalus.nrl.navy.mil
ericy@gnu.ai.mit.edu

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,35 @@
mount/umount/swapon/swapoff(8) for Linux 0.97.3
===============================================
The most significant improvement over the first release is the repair of
at least a half dozen really dumb bugs, mostly involving null pointers.
These bugs caused frequent core dumps and really made the code unusable.
Some race conditions in the lock handling code have been removed.
Swapoff is available for 0.97.3 and later kernels.
Swapon supports multiple swap files. In particular, swapon -a will try
to enable swapping on all the swap entries in /etc/fstab.
File system specific mount options are now supported. This is of particular
utility with Werner Almesberger's msdos fs.
Umount -a now reads /etc/mtab instead of /etc/fstab (thanks to David
Engel for a valuable discussion on this and other points). In addition,
it umounts the entries in reverse order, ensuring that it tries to umount
/usr/spool before /usr, for instance.
Mount will now print mtab for ordinary users as well as for the superuser.
Several people pointed out this deficiency, and it was a real no-brainer
that broke it in the first release.
Thanks to Linus, for another great release. 0.97.3 compiled the first time
out and is working flawlessly. Thanks also to Ross Biro, for his work on
Linux TCP/IP which has made it much easier to get this little thing off my
machine. Special thanks to everyone who put up with my bugs.
Brickbats etc. to
Doug Quale
quale@saavik.cs.wisc.edu

View File

@@ -0,0 +1,57 @@
Well, mount(8) is still disaster. Already I have reports of two problems.
1) It won't compile. This has the advantage that you'll never see any
other bugs, but it does reduce its usefulness somewhat. The mount(2)
prototype I used in sys/mount.h and in the _syscall5 in mount.c doesn't
agree with <unistd.h>. The easy fix is to comment out the prototype in
<unistd.h>, the better fix is to correct my prototypes by adding the
const qualifier to the final parameter of mount(2) in both places.
2) The root entry doesn't get added to the mtab when the mtab is missing.
This used to work right, and the patch below makes it work again.
--- 1.1 1992/09/06 13:30:53
+++ mount.c 1992/09/06 23:57:19
@@ -15,7 +15,7 @@
#include <unistd.h>
_syscall5(int, mount, const char *, special, const char *, dir,
- const char *, type, unsigned long, flags, void *, data);
+ const char *, type, unsigned long, flags, const void *, data);
#endif
--- 1.1 1992/09/06 13:30:53
+++ sundries.c 1992/09/06 23:57:20
@@ -153,6 +153,7 @@
if (addmntent (F_mtab, fstab) == 1)
die (1, "mount: error writing %s: %s", MOUNTED, strerror (errno));
}
+ endmntent (F_mtab);
}
/* Open mtab. */
@@ -159,8 +160,10 @@
void
open_mtab (const char *mode)
{
- if ((F_mtab = setmntent (MOUNTED, mode)) == NULL)
+ if (fopen (MOUNTED, "r") == NULL)
create_mtab ();
+ if ((F_mtab = setmntent (MOUNTED, mode)) == NULL)
+ die (2, "can't open %s: %s", MOUNTED, strerror (errno));
}
/* Close mtab. */
--- sys/mount.h~ Sun Sep 6 08:22:57 1992
+++ sys/mount.h Sun Sep 6 18:57:20 1992
@@ -113,7 +113,7 @@
#ifdef HAVE_MOUNT5
/* 0.96c-pl1 and later we have a five argument mount(2). */
int mount (const char *__special, const char *__dir,
- const char *__type, unsigned long __flags, void *__data);
+ const char *__type, unsigned long __flags, const void *__data);
#else
/* Before 0.96c-pl1 we had a four argument mount(2). */
int mount (const char *__special, const char *__dir,

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,164 @@
README file for the ext file system
Release 0a8
07.09.92
Remy Card
(card@masi.ibp.fr)
This file documents the ext file system for Linux and the programs
needed to use this file system
The ext file system
===================
The ext file system is an extension of the minix file system to get rid
of its restrictions.
The ext file system allows :
- varying length file names from 1 to 255 characters,
- a maximum of 4 Giga blocks per file system, so the maximum size of
a file system is 4 Tera bytes,
- a maximum size of 16 Giga bytes per file,
- a free blocks/inodes management with a linked list so no more
disk space is "lost" for bitmaps.
Limitations of the ext file system
==================================
The ext file system is not yet finished and some modifications will
be made in the future. The current restrictions are :
- some functions in the code are not very well written,
- the ext file system is only able to manage 1024 bytes blocks. Some
people are working to allow the Linux buffer cache to manage bigger
blocks. When it is done, the ext file system will support bigger
blocks.
Status of the ext file system
=============================
Since release 0.96c, the ext file system has been integrated in Linux.
So, there is nothing to modify in the kernel to use this file system. However,
this file system is currently in alpha test and may contain some bugs.
How to use the ext file system
==============================
To use the ext file system, you have to get linux 0.96c or latter.
You also need two programs to create a file system and check that it is
consistent.
These two programs can be obtained by anonymous FTP on ftp-masi.ibp.fr
[132.227.64.26] in the file pub/linux/ALPHA/extfs/efsprogs8.tar.Z or on
tsx-11.mit.edu in the file pub/linux/ALPHA/extfs/efsprogs8.tar.Z. This
file contains the source and binary programs (compiled with GCC 2.2.2d and
linked static) for mkefs (make ext file system) and efsck (ext file system
check). You can also take the file efsprogs8.src.tar.Z which contains only the
source programs or the file efsprogs8.bin.tar.Z which contains only the binary
programs.
You also need to get the new mount and df command from the latest
rootimage. These two commands now use the Linux VFS layer and can be used
with any file system integrated in Linux.
Last, you must recompile every program using the readdir() function
with a version of GCC greater than 2.1 (I suggest using GCC 2.2.2d which is the
"official" C compiler for Linux). Some programs using readdir() are : the GNU
fileutils, tar, the shells (bash, tcsh, zsh), ...
Using an ext file system
========================
To create an ext file system, you must use the mkefs command. Its
syntax is :
mkefs [-c | -l filename] [-i bytes_per_inode] /dev/hdXX size_in_blocks
The arguments for mkefs are :
-c tests bad blocks on the file system,
-l file reads the list of bad blocks from the file,
-i bpi specifies the inode ratio.
To mount an ext file system, you must use the new mount command. The
syntax is : mount -t ext /dev/hdXX /dir
You can also add a line to the file /etc/fstab if you want the ext file
system to be mounted when the system is booted. The format of this line is :
/dev/hdXX /dir ext defaults
After mounting an ext file system, you can use it by the standard
Linux commands (ls, rm, cp, mv, ...).
You can unmount an ext file system by the command :
umount /dev/hdXX
You can check an ext file system by using the efsck command. Its syntax
is :
efsck [-larvsdtS] /dev/hdXX
The arguments for efsck are :
-l lists all the file names in the file system
-a automaically repairs the file system (use with caution)
-r interactively repairs the file system
-v verbose execution
-s lists the super block informations
-d prints debugging output (not very useful except for me
when I try to find bugs in efsck...)
-t tests for bad blocks on the file system
-S salvages the blocks/inodes free lists
Important warnings:
-------------------
1/ efsck comes with NO WARRANTY !! I have written it by using the
minix file system fsck program and it seems to work for me but it has not
been extensively tested. I do not know is fsck is able to repair every
kind of inconsistency. I suggest that you don't use the -a parameter.
2/ when efsck discovers problems in the free blocks/inodes linked lists,
it salvages the lists, i.e. rebuilds them. If efsck rebuilds the lists, there
may problems if the file system is mounted because a copy of the first free
block number and first free inode number is kept in memory for mounted file
systems. If the lists are salvaged, the first free block and first free inode
can change and be different from the ones kept in memory. efsck tries to keep
the same first free block/inode but it is not always possible. When one is
changed, it now prints a warning message.
Future work on the ext fs
=========================
I plan to modify the ext file system to add functionalities or
remove some of its limitations :
- be sure that the efsck program is good and fix its bugs if any,
- fix bugs reported by alpha-testers,
- use bigger blocks as soon as the buffer cache will be able to
manage them, and perhaps use different block sizes in the same
file system (like fragments in BSD).
The next release of the ext fs won't be compatible with the current
one, i.e. a current file system won't be managed by the new code. However,
the new ext fs will be able to coexist with the current one so transition
will be easy. Moreover, a program will be available to convert a current ext
fs to the new format.
How to report bugs
==================
If you encounters a strange behaviour of the ext file system or of
the mkefs and efsck programs, feel free to report them to me (card@masi.ibp.fr)
so that I can find the bugs and fix them. It is also a good idea to report them
to the KERNEL channel of the mailing list and I will send the fixes to this
list.
Credits
=======
The ext fs code originates in the Minix fs management written by Linus
Torvalds. Linus also gave some very good advices during the design of the
ext fs.
I'd like to thank all alpha testers who report bugs or success. These
reports help me to improve the ext fs.
Last but not least, my acknowledgements go to Wayne Davison who makes
a good work in mkefs, efsck and the future conversion program.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,24 @@
WED Jul 29 20:02:06 MET 1992
Zmodem v3.18 for Linux
~~~~~~~~~~~~~~~~~~~~~~
Package info: 'rzsz9202.tar-z' patched with ''rzsz9202.dff.Z'
* * *
Enter 'make' for a list of available targets ('make linux!' for a complete
installation). Please login as 'root' and ensure that the the directories
/usr/local/bin , /usr/local/lib and /usr/man/man1 exist.
The patched sources are ready to compile with GCC 2.2.2. All executables have
been successfully tested under Linux v0.96c-pl2 .
Note: I've added an environment variable called 'RZSZLINE' that points to your
serial port device. It's a good idea to define it when you login, so put the
following statements in your ~/.profile :
RZSZLINE=/dev/ttys0 # or whatever
export RZSZLINE
I'd like to thank Nathan Laredo and Werner Almesberger for their hints and
suggestions.
Have fun with it.
--Fabian Mueller, fabi@imp.ch

Binary file not shown.

Binary file not shown.