Commit 2c0a2456 authored by Linus Torvalds's avatar Linus Torvalds

Import 1.1.76

parent ec1d1994
......@@ -64,6 +64,13 @@ S: Code 930.5, Goddard Space Flight Center
S: Greenbelt, Maryland 20771
S: USA
N: Randolph Bentson
E: bentson@grieg.seaslug.org
D: author of driver for Cyclades Cyclom-Y async mux
S: 2500 Gilman Dr W, #404
S: Seattle, WA 98119-2102
S: USA
N: Stephen R. van den Berg (AKA BuGless)
E: berg@pool.informatik.rwth-aachen.de
D: General kernel, gcc, and libc hacker
......@@ -74,7 +81,7 @@ S: 6369 BG Simpelveld
S: The Netherlands
N: Hennus Bergman
E: hennus@sky.ow.org [My uucp-fed Linux box at home]
E: hennus@sky.ow.nl [My uucp-fed Linux box at home]
D: Author and maintainer of the QIC-02 tape driver
S: The Netherlands
......
......@@ -107,7 +107,16 @@ echo "/*" > $CONFIG_H
echo " * Automatically generated C config: don't edit" >> $CONFIG_H
echo " */" >> $CONFIG_H
DEFAULT=$1
DEFAULT=""
if [ "$1" = "-d" ] ; then
DEFAULT="-d"
shift
fi
CONFIG_IN=./config.in
if [ "$1" != "" ] ; then
CONFIG_IN=$1
fi
if [ -f ./.config ] ; then
. ./.config
......@@ -115,7 +124,7 @@ if [ -f ./.config ] ; then
. /tmp/conf.$$
rm /tmp/conf.$$
fi
. ./config.in
. $CONFIG_IN
if [ "$CONFIG_SOUND" = "y" ] ; then
$MAKE -C drivers/sound config || exit 1
......
VERSION = 1
PATCHLEVEL = 1
SUBLEVEL = 75
SUBLEVEL = 76
ARCH = i386
......@@ -11,6 +11,15 @@ CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
else echo sh; fi ; fi)
TOPDIR := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi)
AS =as
LD =ld
HOSTCC =gcc -I$(TOPDIR)/include
CC =gcc -D__KERNEL__ -I$(TOPDIR)/include
MAKE =make
CPP =$(CC) -E
AR =ar
STRIP =strip
all: do-it-all
#
......@@ -21,7 +30,7 @@ ifeq (.config,$(wildcard .config))
include .config
ifeq (.depend,$(wildcard .depend))
include .depend
do-it-all: Version arch-all
do-it-all: Version vmlinux
else
CONFIGURATION = depend
do-it-all: depend
......@@ -107,33 +116,43 @@ endif
Version: dummy
rm -f include/linux/version.h
boot:
ln -sf arch/$(ARCH)/boot boot
boot: vmlinux
@$(MAKE) -C arch/$(ARCH)/boot
include/asm:
( cd include ; ln -sf asm-$(ARCH) asm)
vmlinux: $(CONFIGURATION) kernel/head.o init/main.o init/version.o linuxsubdirs
$(LD) $(LINKFLAGS) kernel/head.o init/main.o init/version.o \
$(ARCHIVES) \
$(FILESYSTEMS) \
$(DRIVERS) \
$(LIBS) -o vmlinux
nm vmlinux | grep -v '\(compiled\)\|\(\.o$$\)\|\( a \)' | sort > System.map
kernel/entry.S:
symlinks:
rm -f include/asm
( cd include ; ln -sf asm-$(ARCH) asm)
ln -sf ../arch/$(ARCH)/traps.c kernel/traps.c
ln -sf ../arch/$(ARCH)/entry.S kernel/entry.S
ln -sf ../arch/$(ARCH)/head.S kernel/head.S
symlinks: boot include/asm kernel/entry.S
config.in: arch/$(ARCH)/config.in
cp $< $@
oldconfig: symlinks
$(CONFIG_SHELL) Configure -d arch/$(ARCH)/config.in
oldconfig: symlinks config.in
$(CONFIG_SHELL) Configure -d $(OPTS)
config: symlinks config.in
$(CONFIG_SHELL) Configure $(OPTS)
config: symlinks
$(CONFIG_SHELL) Configure arch/$(ARCH)/config.in
linuxsubdirs: dummy
set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i; done
$(TOPDIR)/include/linux/version.h: include/linux/version.h
include/linux/version.h: $(CONFIGURE) Makefile
@./makever.sh
newversion:
@if [ ! -f .version ]; then \
echo 1 > .version; \
else \
expr `cat .version` + 1 > .version; \
fi
include/linux/version.h: $(CONFIGURATION) Makefile newversion
@echo \#define UTS_RELEASE \"$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)\" > include/linux/version.h
@if [ -f .name ]; then \
echo \#define UTS_VERSION \"\#`cat .version`-`cat .name` `date`\"; \
......@@ -150,18 +169,15 @@ include/linux/version.h: $(CONFIGURE) Makefile
fi >> include/linux/version.h
@echo \#define LINUX_COMPILER \"`$(HOSTCC) -v 2>&1 | tail -1`\" >> include/linux/version.h
tools/build: tools/build.c $(CONFIGURE)
$(HOSTCC) $(CFLAGS) -o $@ $< -I$(TOPDIR)/include
kernel/head.o: kernel/head.s
boot/head.o: $(CONFIGURE) boot/head.s
kernel/head.s: kernel/head.S include/linux/tasks.h
$(CPP) -traditional -o $*.s $<
boot/head.s: boot/head.S $(CONFIGURE) include/linux/tasks.h
$(CPP) -traditional $< -o $@
init/version.o: init/version.c include/linux/version.h
$(CC) $(CFLAGS) -DUTS_MACHINE='"$(ARCH)"' -c -o init/version.o init/version.c
tools/version.o: tools/version.c include/linux/version.h
$(CC) $(CFLAGS) -DUTS_MACHINE='"$(ARCH)"' -c -o tools/version.o tools/version.c
init/main.o: $(CONFIGURE) init/main.c
init/main.o: init/main.c
$(CC) $(CFLAGS) $(PROFILING) -c -o $*.o $<
fs: dummy
......@@ -189,16 +205,14 @@ clean: archclean
rm -f kernel/ksyms.lst
rm -f core `find . -name '*.[oas]' -print`
rm -f core `find . -name 'core' -print`
rm -f zImage zSystem.map tools/zSystem tools/system
rm -f Image System.map tools/build
rm -f zBoot/zSystem zBoot/xtract zBoot/piggyback
rm -f vmlinux System.map
rm -f .tmp* drivers/sound/configure
mrproper: clean
rm -f include/linux/autoconf.h include/linux/version.h
rm -f drivers/sound/local.h
rm -f .version .config* config.in config.old
rm -f boot include/asm kernel/entry.S
rm -f include/asm kernel/entry.S kernel/head.S kernel/traps.c
rm -f .depend `find . -name .depend -print`
distclean: mrproper
......@@ -207,10 +221,9 @@ backup: mrproper
cd .. && tar cf - linux | gzip -9 > backup.gz
sync
depend dep:
depend dep: archdep
touch include/linux/version.h
for i in init/*.c;do echo -n "init/";$(CPP) -M $$i;done > .tmpdepend
for i in tools/*.c;do echo -n "tools/";$(CPP) -M $$i;done >> .tmpdepend
set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i dep; done
rm -f include/linux/version.h
mv .tmpdepend .depend
......@@ -233,20 +246,3 @@ else
dummy:
endif
#
# Leave these dummy entries for now to tell people that they are going away..
#
Image:
@echo
@echo Uncompressed kernel images no longer supported. Use
@echo \"make zImage\" instead.
@echo
@exit 1
disk:
@echo
@echo Uncompressed kernel images no longer supported. Use
@echo \"make zdisk\" instead.
@echo
@exit 1
......@@ -8,37 +8,9 @@
# Copyright (C) 1994 by Linus Torvalds
#
AS =as
LD =ld
HOSTCC =gcc -I$(TOPDIR)/include
CC =gcc -D__KERNEL__ -I$(TOPDIR)/include
MAKE =make
CPP =$(CC) -E
AR =ar
STRIP =strip
arch-all: tools/system
tools/system: boot/head.o init/main.o tools/version.o linuxsubdirs
$(LD) $(LOWLDFLAGS) boot/head.o init/main.o tools/version.o \
$(ARCHIVES) \
$(FILESYSTEMS) \
$(DRIVERS) \
$(LIBS) \
-o tools/system
nm tools/zSystem | grep -v '\(compiled\)\|\(\.o$$\)\|\( a \)' | \
sort > System.map
#
# Leave these dummy entries for now to tell people that they are going away..
#
lilo:
@echo
@echo Uncompressed kernel images no longer supported. Use
@echo \"make zlilo\" instead.
@echo
@exit 1
LINKFLAGS = -non_shared -T 0xfffffc0000304000 -N
CFLAGS := $(CFLAGS) -mno-fp-regs
archclean:
@rm -f boot/head.o
archdep:
#
# arch/alpha/boot/Makefile
#
# This file is subject to the terms and conditions of the GNU General Public
# License. See the file "COPYING" in the main directory of this archive
# for more details.
#
# Copyright (C) 1994 by Linus Torvalds
#
boot:
@echo Wait a few days for this one..
@exit 1
dep:
clean:
/*
* arch/alpha/boot/tools/build.c
*
* Build a bootable image from the vmlinux binary
*/
#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <a.out.h>
#include <asm/system.h>
#define NR_SECTORS (START_SIZE / 512)
#define MAXSECT 10
#define MAXBUF 8192
int verbose = 0;
char * program = "tools/build";
char buffer[MAXBUF];
unsigned long bootblock[64];
struct filehdr fhdr;
struct aouthdr ahdr;
struct scnhdr shdr[MAXSECT];
char * usage = "'build system > secondary' or 'build > primary'";
static void die(char * str)
{
fprintf(stderr,"%s: %s\n", program, str);
exit(1);
}
static int comp(struct scnhdr * a, struct scnhdr * b)
{
return a->s_vaddr - b->s_vaddr;
}
int main(int argc, char ** argv)
{
int fd, i;
unsigned long tmp;
unsigned long start;
char * infile = NULL;
if (argc) {
program = *(argv++);
argc--;
}
while (argc > 0) {
if (**argv == '-') {
while (*++*argv) {
switch (**argv) {
case 'v':
verbose++;
break;
default:
die(usage);
}
}
} else if (infile)
die(usage);
else
infile = *argv;
argv++;
argc--;
}
if (!infile) {
memcpy(bootblock, "Linux Test", 10);
bootblock[60] = NR_SECTORS; /* count (32 kB) */
bootblock[61] = 1; /* starting LBM */
bootblock[62] = 0; /* flags */
tmp = 0;
for (i = 0 ; i < 63 ; i++)
tmp += ~bootblock[i];
bootblock[63] = tmp;
if (write(1, (char *) bootblock, 512) != 512) {
perror("bbwrite");
exit(1);
}
return 0;
}
fd = open(infile, O_RDONLY);
if (fd < 0) {
perror(infile);
exit(1);
}
if (read(fd, &fhdr, sizeof(struct filehdr)) != sizeof(struct filehdr))
die("unable to read file header");
if (fhdr.f_nscns > MAXSECT)
die("Too many sections");
if (fhdr.f_opthdr != AOUTHSZ)
die("optional header doesn't look like a.out");
if (read(fd, &ahdr, sizeof(struct aouthdr)) != sizeof(struct aouthdr))
die("unable to read a.out header");
for (i = 0 ; i < fhdr.f_nscns ; i++) {
if (read(fd, i+shdr, sizeof(struct scnhdr)) != sizeof(struct scnhdr))
die("unable to read section header");
if (shdr[i].s_paddr != shdr[i].s_vaddr)
die("unable to handle different phys/virt addresses");
if (shdr[i].s_relptr)
die("Unable to handle relocation info");
if (verbose) {
fprintf(stderr, "section %d (%.8s):\t%lx - %lx (at %x)\n",
i, shdr[i].s_name,
shdr[i].s_vaddr,
shdr[i].s_vaddr + shdr[i].s_size,
shdr[i].s_scnptr);
}
}
qsort(shdr, fhdr.f_nscns, sizeof(shdr[1]), comp);
start = START_ADDR;
for (i = 0 ; i < fhdr.f_nscns ; i++) {
unsigned long size, offset;
memset(buffer, 0, MAXBUF);
if (!strcmp(shdr[i].s_name, ".comment"))
continue;
if (shdr[i].s_vaddr != start)
die("Unordered or badly placed segments");
size = shdr[i].s_size;
start += size;
offset = shdr[i].s_scnptr;
if (lseek(fd, offset, SEEK_SET) != offset)
die("Unable to seek in in-file");
while (size > 0) {
unsigned long num = size;
if (num > MAXBUF)
num = MAXBUF;
if (offset)
if (read(fd, buffer, num) != num)
die("partial read");
if (write(1, buffer, num) != num)
die("partial write");
size -= num;
}
if (verbose) {
fprintf(stderr, "section %d (%.8s):\t%lx - %lx (at %x)\n",
i, shdr[i].s_name,
shdr[i].s_vaddr,
shdr[i].s_vaddr + shdr[i].s_size,
shdr[i].s_scnptr);
}
}
if (start > START_ADDR + NR_SECTORS*512) {
fprintf(stderr, "Boot image too large\n");
exit(1);
}
return 0;
}
......@@ -5,6 +5,7 @@
comment 'General setup'
bool 'Normal floppy disk support' CONFIG_BLK_DEV_FD y
bool 'Normal harddisk support' CONFIG_BLK_DEV_HD n
bool 'XT harddisk support' CONFIG_BLK_DEV_XD n
bool 'Networking support' CONFIG_NET y
......@@ -16,6 +17,9 @@ comment 'Networking options'
bool 'TCP/IP networking' CONFIG_INET y
if [ "$CONFIG_INET" "=" "y" ]; then
bool 'IP forwarding/gatewaying' CONFIG_IP_FORWARD n
bool 'IP multicasting (ALPHA)' CONFIG_IP_MULTICAST n
bool 'IP firewalling' CONFIG_IP_FIREWALL n
bool 'IP accounting' CONFIG_IP_ACCT n
comment '(it is safe to leave these untouched)'
bool 'PC/TCP compatibility mode' CONFIG_INET_PCTCP n
bool 'Reverse ARP' CONFIG_INET_RARP n
......@@ -53,15 +57,17 @@ bool 'BusLogic SCSI support' CONFIG_SCSI_BUSLOGIC n
bool 'UltraStor 14F/34F support' CONFIG_SCSI_U14_34F n
bool 'Future Domain 16xx SCSI support' CONFIG_SCSI_FUTURE_DOMAIN n
bool 'Generic NCR5380 SCSI support' CONFIG_SCSI_GENERIC_NCR5380 n
bool 'NCR53c7,8xx SCSI support' CONFIG_SCSI_NCR53C7xx n
bool 'Always IN2000 SCSI support' CONFIG_SCSI_IN2000 n
if [ "$CONFIG_PCI" = "y" ]; then
bool 'NCR53c7,8xx SCSI support' CONFIG_SCSI_NCR53C7xx n
fi
bool 'Always IN2000 SCSI support (test release)' CONFIG_SCSI_IN2000 n
bool 'PAS16 SCSI support' CONFIG_SCSI_PAS16 n
bool 'QLOGIC SCSI support' CONFIG_SCSI_QLOGIC n
bool 'Seagate ST-02 and Future Domain TMC-8xx SCSI support' CONFIG_SCSI_SEAGATE n
bool 'Trantor T128/T128F/T228 SCSI support' CONFIG_SCSI_T128 n
bool 'UltraStor SCSI support' CONFIG_SCSI_ULTRASTOR n
bool '7000FASST SCSI support' CONFIG_SCSI_7000FASST n
bool 'EISA EATA support' CONFIG_SCSI_EATA n
bool 'EATA ISA/EISA (DPT PM2011/021/012/022/122/322) support' CONFIG_SCSI_EATA n
#bool 'SCSI debugging host adapter' CONFIG_SCSI_DEBUG n
fi
......@@ -80,6 +86,7 @@ bool 'Dummy net driver support' CONFIG_DUMMY n
bool 'SLIP (serial line) support' CONFIG_SLIP n
if [ "$CONFIG_SLIP" = "y" ]; then
bool ' CSLIP compressed headers' SL_COMPRESSED y
bool ' 16 channels instead of 4' SL_SLIP_LOTS n
# bool ' SLIP debugging on' SL_DUMP y
fi
bool 'PPP (point-to-point) support' CONFIG_PPP n
......@@ -91,6 +98,7 @@ if [ "$CONFIG_NET_VENDOR_SMC" = "y" ]; then
bool 'WD80*3 support' CONFIG_WD80x3 n
bool 'SMC Ultra support' CONFIG_ULTRA n
fi
bool 'AMD LANCE and PCnet (AT1500 and NE2100) support' CONFIG_LANCE n
bool '3COM cards' CONFIG_NET_VENDOR_3COM n
if [ "$CONFIG_NET_VENDOR_3COM" = "y" ]; then
bool '3c501 support' CONFIG_EL1 n
......@@ -103,32 +111,41 @@ if [ "$CONFIG_NET_VENDOR_3COM" = "y" ]; then
fi
bool 'Other ISA cards' CONFIG_NET_ISA y
if [ "$CONFIG_NET_ISA" = "y" ]; then
bool 'AT1500 and NE2100 (LANCE and PCnet-ISA) support' CONFIG_LANCE n
bool 'Cabletron E21xx support (not recommended)' CONFIG_E2100 n
bool 'Cabletron E21xx support' CONFIG_E2100 n
bool 'DEPCA support' CONFIG_DEPCA y
bool 'EtherWorks 3 support' CONFIG_EWRK3 n
if [ "$CONFIG_NET_ALPHA" = "y" ]; then
bool 'EtherExpress support' CONFIG_EEXPRESS n
# bool 'Arcnet support' CONFIG_ARCNET n
bool 'AT1700 support' CONFIG_AT1700 n
# bool 'EtherExpressPro support' CONFIG_EEXPRESS_PRO n
bool 'EtherExpress support' CONFIG_EEXPRESS n
bool 'NI5210 support' CONFIG_NI52 n
bool 'NI6510 support' CONFIG_NI65 n
fi
bool 'HP PCLAN support' CONFIG_HPLAN n
bool 'HP PCLAN PLUS support' CONFIG_HPLAN_PLUS n
bool 'HP PCLAN+ (27247B and 27252A) support' CONFIG_HPLAN_PLUS n
bool 'HP PCLAN (27245 and other 27xxx series) support' CONFIG_HPLAN n
bool 'NE2000/NE1000 support' CONFIG_NE2000 n
bool 'SK_G16 support' CONFIG_SK_G16 n
fi
bool 'EISA and on board controllers' CONFIG_NET_EISA n
bool 'EISA, VLB, PCI and on board controllers' CONFIG_NET_EISA n
if [ "$CONFIG_NET_EISA" = "y" ]; then
if [ "$CONFIG_NET_ALPHA" = "y" ]; then
bool 'Ansel Communications EISA 3200 support' CONFIG_AC3200 n
fi
bool 'Apricot Xen-II on board ethernet' CONFIG_APRICOT n
# bool 'DEC 21040 PCI support' CONFIG_DEC_ELCP n
# bool 'LPL T100V 100Mbs support' CONFIG_LPL_T100 n
# bool 'PCnet32 (32 bit VLB and PCI LANCE) support' CONFIG_PCNET32 n
bool 'Zenith Z-Note support' CONFIG_ZNET y
fi
bool 'Pocket and portable adaptors' CONFIG_NET_POCKET n
if [ "$CONFIG_NET_POCKET" = "y" ]; then
bool 'AT-LAN-TEC/RealTek pocket adaptor support' CONFIG_ATP n
bool 'D-Link DE600 pocket adaptor support' CONFIG_DE600 n
bool 'D-Link DE620 pocket adaptor support' CONFIG_DE620 n
bool 'AT-LAN-TEC/RealTek pocket adaptor support' CONFIG_ATP n
bool 'Zenith Z-Note support' CONFIG_ZNET n
# bool 'Silicom pocket adaptor support' CONFIG_SILICOM_PEA n
# bool 'WaveLAN PCMCIA support' CONFIG_WaveLAN n
# bool '3 Com 3c589 PCMCIA support' CONFIG_3C589 n
fi
fi
fi
......@@ -172,6 +189,7 @@ bool 'System V and Coherent filesystem support' CONFIG_SYSV_FS n
comment 'character devices'
bool 'Cyclades async mux support' CONFIG_CYCLADES n
bool 'Parallel printer support' CONFIG_PRINTER n
bool 'Logitech busmouse support' CONFIG_BUSMOUSE n
bool 'PS/2 mouse (aka "auxiliary device") support' CONFIG_PSMOUSE y
......@@ -181,6 +199,11 @@ fi
bool 'Microsoft busmouse support' CONFIG_MS_BUSMOUSE n
bool 'ATIXL busmouse support' CONFIG_ATIXL_BUSMOUSE n
bool 'Selection (cut and paste for virtual consoles)' CONFIG_SELECTION n
bool 'VESA Power Saving Protocol Support' CONFIG_VESA_PSPM n
if [ "$CONFIG_VESA_PSPM" = "y" ]; then
bool 'VESA PSPM Force Off' CONFIG_PSPM_FORCE_OFF n
fi
bool 'QIC-02 tape support' CONFIG_QIC02_TAPE n
if [ "$CONFIG_QIC02_TAPE" = "y" ]; then
......@@ -210,6 +233,9 @@ comment 'Kernel hacking'
#bool 'Debug kmalloc/kfree' CONFIG_DEBUG_MALLOC n
bool 'Kernel profiling support' CONFIG_PROFILE n
if [ "$CONFIG_PROFILE" = "y" ]; then
int ' Profile shift count' CONFIG_PROFILE_SHIFT 2
fi
if [ "$CONFIG_SCSI" = "y" ]; then
bool 'Verbose scsi error reporting (kernel size +=12K)' CONFIG_SCSI_CONSTANTS y
fi
/*
* alpha/entry.S
*
* kernel entry-points
*/
#define __ASSEMBLY__
#include <asm/system.h>
#define halt .long PAL_halt
#define rti .long RAL_rti
.text
.set noat
.align 6
.ent entInt
entInt:
subq $30,144,$30
stq $0,0($30)
stq $1,8($30)
stq $2,16($30)
stq $3,24($30)
stq $4,32($30)
stq $5,40($30)
stq $6,48($30)
stq $7,56($30)
stq $8,64($30)
stq $19,64($30)
stq $20,72($30)
stq $21,80($30)
stq $22,88($30)
stq $23,96($30)
stq $24,104($30)
stq $25,112($30)
stq $26,120($30)
stq $27,128($30)
stq $28,136($30)
lda $27,do_hw_interrupt
jsr $26,($27),do_hw_interrupt
ldq $0,0($30)
ldq $1,8($30)
ldq $2,16($30)
ldq $3,24($30)
ldq $4,32($30)
ldq $5,40($30)
ldq $6,48($30)
ldq $7,56($30)
ldq $8,64($30)
ldq $19,64($30)
ldq $20,72($30)
ldq $21,80($30)
ldq $22,88($30)
ldq $23,96($30)
ldq $24,104($30)
ldq $25,112($30)
ldq $26,120($30)
ldq $27,128($30)
ldq $28,136($30)
addq $30,144,$30
rti
.end entInt
/*
* alpha/head.S
* alpha/boot/head.S
*
* initial boot stuff..
*/
#define __ASSEMBLY__
#include <asm/system.h>
#undef halt
#define halt .long PAL_halt
/*
......
/*
* kernel/traps.c
*
* (C) Copyright 1994 Linus Torvalds
*/
/*
* This file initializes the trap entry points
*/
#include <linux/sched.h>
#include <asm/system.h>
#include <asm/io.h>
extern asmlinkage void entInt(void);
void keyboard_interrupt(void);
void do_hw_interrupt(unsigned long type, unsigned long vector)
{
if (type == 1) {
jiffies++;
return;
}
/* keyboard or mouse */
if (type == 3) {
if (vector == 0x980) {
keyboard_interrupt();
return;
} else {
unsigned char c = inb_local(0x64);
printk("IO device interrupt, vector = %lx\n", vector);
if (!(c & 1)) {
int i;
printk("Hmm. Keyboard interrupt, status = %02x\n", c);
for (i = 0; i < 10000000 ; i++)
/* nothing */;
printk("Serial line interrupt status: %02x\n", inb_local(0x3fa));
} else {
c = inb_local(0x60);
printk("#%02x# ", c);
}
return;
}
}
printk("Hardware intr %ld %ld\n", type, vector);
}
void trap_init(void)
{
unsigned long gptr;
__asm__("br %0,___tmp\n"
"___tmp:\tldgp %0,0(%0)"
: "=r" (gptr));
wrkgp(gptr);
wrent(entInt, 0);
}
#
# i386/Makefile
#
# This file is included by the global makefile so that you can add your own
# architecture-specific flags and dependencies. Remember to do have actions
# for "archclean" and "archdep" for cleaning up and making dependencies for
# this architecture
#
# This file is subject to the terms and conditions of the GNU General Public
# License. See the file "COPYING" in the main directory of this archive
# for more details.
......@@ -8,17 +13,18 @@
# Copyright (C) 1994 by Linus Torvalds
#
AS86 =as86 -0 -a
LD86 =ld86 -0
AS =as
LD =ld
HOSTCC =gcc -I$(TOPDIR)/include
CC =gcc -D__KERNEL__ -I$(TOPDIR)/include
MAKE =make
CPP =$(CC) -E
AR =ar
STRIP =strip
#
# Set these to indicate how to link it..
#
# -zmagic:
#
# ZLINKFLAGS = -Ttext 0x1000
# LINKFLAGS = -Ttext 0x100000
#
# -qmagic (we need to remove the 32 byte header for bootup purposes)
#
ZLINKFLAGS =-qmagic -Ttext 0xfe0
LINKFLAGS =-qmagic -Ttext 0xfffe0
CFLAGS := $(CFLAGS) -pipe
ifdef CONFIG_M486
......@@ -31,85 +37,18 @@ CFLAGS := $(CFLAGS) -m386
endif
endif
arch-all: zImage
zBoot/zSystem: zBoot/*.c zBoot/*.S tools/zSystem
$(MAKE) -C zBoot
zImage: $(CONFIGURE) boot/bootsect boot/setup zBoot/zSystem tools/build
tools/build boot/bootsect boot/setup zBoot/zSystem $(ROOT_DEV) > zImage
sync
zdisk: zImage
dd bs=8192 if=zImage of=/dev/fd0
zlilo: $(CONFIGURE) zImage
if [ -f $(INSTALL_PATH)/vmlinuz ]; then mv $(INSTALL_PATH)/vmlinuz $(INSTALL_PATH)/vmlinuz.old; fi
if [ -f $(INSTALL_PATH)/zSystem.map ]; then mv $(INSTALL_PATH)/zSystem.map $(INSTALL_PATH)/zSystem.old; fi
cat zImage > $(INSTALL_PATH)/vmlinuz
cp zSystem.map $(INSTALL_PATH)/
if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi
#
# Set these to indicate how to link it..
#
# -zmagic:
#
#LOWLDFLAGS = -Ttext 0x1000
#HIGHLDFLAGS = -Ttext 0x100000
#
# -qmagic (we need to remove the 32 byte header for bootup purposes)
#
LOWLDFLAGS =-qmagic -Ttext 0xfe0
HIGHLDFLAGS =-qmagic -Ttext 0xfffe0
tools/system: boot/head.o init/main.o tools/version.o linuxsubdirs
$(LD) $(LOWLDFLAGS) boot/head.o init/main.o tools/version.o \
$(ARCHIVES) \
$(FILESYSTEMS) \
$(DRIVERS) \
$(LIBS) \
-o tools/system
nm tools/zSystem | grep -v '\(compiled\)\|\(\.o$$\)\|\( a \)' | \
sort > System.map
boot/setup: boot/setup.o
$(LD86) -s -o $@ $<
MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
boot/setup.o: boot/setup.s
$(AS86) -o $@ $<
zImage: vmlinux
@$(MAKEBOOT) zImage
boot/setup.s: boot/setup.S $(CONFIGURE) include/linux/config.h Makefile
$(CPP) -traditional $(SVGA_MODE) $(RAMDISK) $< -o $@
compressed: zImage
boot/bootsect: boot/bootsect.o
$(LD86) -s -o $@ $<
boot/bootsect.o: boot/bootsect.s
$(AS86) -o $@ $<
boot/bootsect.s: boot/bootsect.S $(CONFIGURE) include/linux/config.h Makefile
$(CPP) -traditional $(SVGA_MODE) $(RAMDISK) $< -o $@
tools/zSystem: boot/head.o init/main.o tools/version.o linuxsubdirs
$(LD) $(HIGHLDFLAGS) boot/head.o init/main.o tools/version.o \
$(ARCHIVES) \
$(FILESYSTEMS) \
$(DRIVERS) \
$(LIBS) \
-o tools/zSystem
nm tools/zSystem | grep -v '\(compiled\)\|\(\.o$$\)\|\( a \)' | \
sort > zSystem.map
#
# Leave these dummy entries for now to tell people that they are going away..
#
lilo:
@echo
@echo Uncompressed kernel images no longer supported. Use
@echo \"make zlilo\" instead.
@echo
@exit 1
zlilo: vmlinux
@$(MAKEBOOT) zlilo
archclean:
rm -f boot/bootsect boot/setup
@$(MAKEBOOT) clean
archdep:
@$(MAKEBOOT) dep
#
# arch/i386/boot/Makefile
#
# This file is subject to the terms and conditions of the GNU General Public
# License. See the file "COPYING" in the main directory of this archive
# for more details.
#
# Copyright (C) 1994 by Linus Torvalds
#
AS86 =as86 -0 -a
LD86 =ld86 -0
zImage: $(CONFIGURE) bootsect setup compressed/vmlinux tools/build
tools/build bootsect setup compressed/vmlinux $(ROOT_DEV) > zImage
sync
compressed/vmlinux: $(TOPDIR)/vmlinux
@$(MAKE) -C compressed vmlinux
zdisk: zImage
dd bs=8192 if=zImage of=/dev/fd0
zlilo: $(CONFIGURE) zImage
if [ -f $(INSTALL_PATH)/vmlinuz ]; then mv $(INSTALL_PATH)/vmlinuz $(INSTALL_PATH)/vmlinuz.old; fi
if [ -f $(INSTALL_PATH)/System.map ]; then mv $(INSTALL_PATH)/System.map $(INSTALL_PATH)/System.old; fi
cat zImage > $(INSTALL_PATH)/vmlinuz
cp $(TOPDIR)/System.map $(INSTALL_PATH)/
if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi
tools/build: tools/build.c
$(HOSTCC) $(CFLAGS) -o $@ $< -I$(TOPDIR)/include
setup: setup.o
$(LD86) -s -o $@ $<
setup.o: setup.s
$(AS86) -o $@ $<
setup.s: setup.S $(CONFIGURE) $(TOPDIR)/include/linux/config.h Makefile
$(CPP) -traditional $(SVGA_MODE) $(RAMDISK) $< -o $@
bootsect: bootsect.o
$(LD86) -s -o $@ $<
bootsect.o: bootsect.s
$(AS86) -o $@ $<
bootsect.s: bootsect.S $(CONFIGURE) $(TOPDIR)/include/linux/config.h Makefile
$(CPP) -traditional $(SVGA_MODE) $(RAMDISK) $< -o $@
dep:
clean:
rm -f bootsect setup
rm -f zImage tools/build
@$(MAKE) -C compressed clean
#
# linux/archi/i386/boot/compressed/Makefile
#
# create a compressed vmlinux image from the original vmlinux
#
HEAD = head.o
SYSTEM = ../tools/zSystem
#LD = gcc
#TEST = -DTEST_DRIVER
SYSTEM = $(TOPDIR)/vmlinux
zOBJECTS = $(HEAD) inflate.o unzip.o misc.o
OBJECTS = $(HEAD) inflate.o unzip.o misc.o
CFLAGS = -O2 -DSTDC_HEADERS $(TEST)
CFLAGS = -O2 -DSTDC_HEADERS
.c.s:
$(CC) $(CFLAGS) -S $<
......@@ -15,18 +18,18 @@ CFLAGS = -O2 -DSTDC_HEADERS $(TEST)
.c.o:
$(CC) $(CFLAGS) -c $<
all: zSystem
all: vmlinux
zSystem: piggy.o $(zOBJECTS)
$(LD) $(LOWLDFLAGS) -o zSystem $(zOBJECTS) piggy.o
vmlinux: piggy.o $(OBJECTS)
$(LD) $(ZLINKFLAGS) -o vmlinux $(OBJECTS) piggy.o
head.o: head.s
head.s: head.S ../include/linux/tasks.h
head.s: head.S $(TOPDIR)/include/linux/tasks.h
$(CPP) -traditional head.S -o head.s
piggy.o: $(SYSTEM) xtract piggyback
./xtract $(SYSTEM) | gzip -9 | ./piggyback > piggy.o
$(SYSTEM):
$(MAKE) -C .. tools/zSystem
clean:
rm -f xtract piggyback vmlinux
......@@ -7,7 +7,19 @@ comment 'General setup'
bool 'Kernel math emulation' CONFIG_MATH_EMULATION n
bool 'Normal floppy disk support' CONFIG_BLK_DEV_FD y
bool 'Normal harddisk support' CONFIG_BLK_DEV_HD y
bool 'Normal (MFM/RLL) disk and IDE disk/cdrom support' CONFIG_ST506 y
if [ "$CONFIG_ST506" = "y" ]; then
bool ' Use old (reliable) disk-only driver for primary i/f' CONFIG_BLK_DEV_HD y
if [ "$CONFIG_BLK_DEV_HD" = "y" ]; then
bool ' Include new IDE driver for secondary i/f support' CONFIG_BLK_DEV_IDE n
else
bool ' Use new IDE driver for primary/secondary i/f' CONFIG_BLK_DEV_IDE y
fi
if [ "$CONFIG_BLK_DEV_IDE" = "y" ]; then
bool ' Include support for IDE CDROM (ATAPI)' CONFIG_BLK_DEV_IDECD n
fi
fi
bool 'XT harddisk support' CONFIG_BLK_DEV_XD n
bool 'Networking support' CONFIG_NET y
bool 'Limit memory to low 16MB' CONFIG_MAX_16M n
......@@ -206,10 +218,6 @@ fi
bool 'Microsoft busmouse support' CONFIG_MS_BUSMOUSE n
bool 'ATIXL busmouse support' CONFIG_ATIXL_BUSMOUSE n
bool 'Selection (cut and paste for virtual consoles)' CONFIG_SELECTION n
bool 'VESA Power Saving Protocol Support' CONFIG_VESA_PSPM n
if [ "$CONFIG_VESA_PSPM" = "y" ]; then
bool 'VESA PSPM Force Off' CONFIG_PSPM_FORCE_OFF n
fi
bool 'QIC-02 tape support' CONFIG_QIC02_TAPE n
......
/*
* linux/boot/head.S
* linux/arch/i386/head.S
*
* Copyright (C) 1991, 1992 Linus Torvalds
*/
......
/*
* linux/kernel/traps.c
* linux/arch/i386/traps.c
*
* Copyright (C) 1991, 1992 Linus Torvalds
*/
......
#!/bin/sh
makedev () {
rm -f /dev/$1
echo mknod /dev/$1 $2 $3 $4 &&
mknod /dev/$1 $2 $3 $4 &&
chown $5 /dev/$1 &&
chmod $6 /dev/$1
}
# Create /dev/hdc*
makedev hdc b 22 0 root:$disk 660
for part in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
do
makedev hdc$part b 22 `expr 0 + $part` root:$disk 660
done
echo " "
# Create /dev/hdd*
makedev hdd b 22 64 root:$disk 660
for part in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
do
makedev hdd$part b 22 `expr 64 + $part` root:$disk 660
done
......@@ -59,6 +59,11 @@ OBJS := $(OBJS) hd.o
SRCS := $(SRCS) hd.c
endif
ifdef CONFIG_BLK_DEV_IDE
OBJS := ide.o $(OBJS)
SRCS := ide.c $(SRCS)
endif
ifdef CONFIG_BLK_DEV_XD
OBJS := $(OBJS) xd.o
SRCS := $(SRCS) xd.c
......
README.ide -- Information regarding ide.c and ide-cd.c
================================================================================
Supported by: mlord@bnr.ca -- disks, interfaces, probing
snyder@fnald0.fnal.gov -- cdroms, ATAPI, audio
(see description later on below for handling BIG IDE drives with >1024 cyls).
Major features of ide.c & ide-cd.c:
- support for up to two IDE interfaces on one or two IRQs
- support for any mix of up to four disk and/or cdrom drives
- support for reading IDE ATAPI cdrom drives (NEC, MITSUMI, VERSA)
- support for audio functions on FX400,NEC-260 cdrom drives (others?)
- auto-detection of interfaces, drives, IRQs, and disk geometries
- support for BIOSs which report "more than 16 heads" on disk drives
- uses LBA (slightly faster) on disk drives which support it
- support for lots of fancy (E)IDE drive functions with hdparm utility
- optional (compile time) support for 32-bit VLB data transfers
- support for IDE multiple (block) mode (same as hd.c)
- support for interrupt unmasking during I/O (better than hd.c)
- auto detection/use of multiple (block) mode settings from BIOS
- improved handshaking and error detection/recovery
- can co-exist with hd.c to control only the secondary interface
Under construction:
- support for interface speed selection on jumperless interfaces
- improved detection of non-standard IDE ATAPI cdrom drives
To access devices on the second interface, device entries must first be
created in /dev for them. To create such entries, simply run the included
shell script: MAKEDEV.ide1
ide.c automatically probes for the primary and secondary interfaces,
for the drives/geometries attached to those interfaces, and for the
IRQ numbers being used by the interfaces (normally IRQ14 & IRQ15).
The primary and secondary interfaces may share a single IRQ if necessary,
at a slight performance penalty, whether on separate cards or a single VLB card.
Drives are normally found by auto-probing and/or examining the CMOS/BIOS data.
For really weird situations, the apparent (fdisk) geometry can also be specified
on the kernel "command line" using LILO. The format of such lines is:
hdx=cyls,heads,sects,wpcom,irq
or hdx=cdrom
where hdx can be any of {hda,hdb,hdc,hdd}, or simply hd, for the "next" drive
in sequence. Only the first three parameters are required (cyls,heads,sects),
and wpcom is ignored for IDE drives.
Example: hdc=1050,32,64 hdd=cdrom
If an irq number is given, it will apply to both drives on the same interface,
either {hda,hdb} or {hdc,hdd}. The results of successful auto-probing may
override the physical geometry/irq specified, though the "original" geometry
is retained as the "logical" geometry for partitioning purposes (fdisk).
Courtesy of Scott Snyder, the driver now supports ATAPI cdrom drives
such as the NEC-260 and the new MITSUMI triple/quad speed drives.
Such drives will be identified at boot time, as hda,hdb,hdc or hdd,
just like a harddisk.
If for some reason your cdrom drive is *not* found at boot time, you can force
the probe to look harder by supplying a kernel command line parameter
via LILO, such as: hdc=cdrom
For example, a GW2000 system might have a harddrive on the primary
interface (/dev/hda) and an IDE cdrom drive on the secondary interface
(/dev/hdc). To mount a CD in the cdrom drive, one would use something like:
ln -sf /dev/hdc /dev/cdrom
mkdir /cd
mount /dev/cdrom /cd -t iso9660 -o ro,block=2048
Please pass on any feedback on the cdrom stuff to the author & maintainer,
Scott Snyder (snyder@fnald0.fnal.gov).
Note that present, the kernel is unable to execute demand-paged binaries
directly off of the cdrom (due to the different block size).
The hdparm.c program for controlling various IDE features is now packaged
separately. Look for it on popular linux FTP sites.
mlord@bnr.ca
snyder@fnald0.fnal.gov
================================================================================
How To Use *Big* IDE drives with Linux/DOS
------------------------------------------
All IDE drives larger than 504MB ("528Meg") use a "physical" geometry which
has more than 1024 cylinders. This presents two problems to most systems:
1. The INT13 interface to the BIOS only allows 10-bits for cylinder
addresses, giving a limit of 1024cyls for programs which use it.
2. The physical geometry fields of the disk partition table only
allows 10-bits for cylinder addresses, giving a similar limit of 1024
cyls for operating systems that do not use the "sector count" fields
instead of the physical Cyl/Head/Sect (CHS) geometry fields.
Neither of these limitations affects Linux itself, as it (1) does not use the
BIOS for disk access, and it (2) is clever enough to use the "sector count"
fields of the partition table instead of the physical CHS geometry fields.
a) Most folks use LILO to load linux. LILO uses the INT13 interface
to the BIOS to load the kernel at boot time. Therefore, LILO can only
load linux if the files it needs (usually just the kernel images) are
located below the magic 1024 cylinder "boundary".
b) Many folks also like to have bootable DOS partitions on their
drive(s). DOS also uses the INT13 interface to the BIOS, not only
for booting, but also for operation after booting. Therefore, DOS
can normally only access partitions which are contained entirely below
the magic 1024 cylinder "boundary".
There are at least seven commonly used schemes for kludging DOS to work
around this "limitation". In the long term, the problem is being solved
by introduction of an alternative BIOS interface that does not have the
same limitations as the INT13 interface. New versions of DOS are expected
to detect and use this interface in systems whose BIOS provides it.
But in the present day, alternative solutions are necessary.
The most popular solution in newer systems is to have the BIOS shift bits
between the cylinder and head number fields. This is activated by entering
a translated logical geometry into the BIOS/CMOS setup for the drive.
Thus, if the drive has a geometry of 2100/16/63 (CHS), then the BIOS could
present a "logical" geometry of 525/64/63 by "shifting" two bits from the
cylinder number into the head number field for purposes of the partition table, CMOS setup, and INT13 interfaces. Linux kernels 1.1.39 and higher detect and
"handle" this translation automatically, making this a rather painless solution
for the 1024 cyls problem. If for some reason Linux gets confused (unlikely),
then use the kernel command line parameters to pass the *logical* geometry,
as in: hda=525,64,63
If the BIOS does not support this form of drive translation, then several
options remain, listed below in order of increasing popularity:
- rewrite LILO to bypass the BIOS and talk directly to the drive
- boot from a floppy disk instead of the hard drive (takes 10 seconds)
- use a partition below the 1024 cyl boundary to hold the linux
boot files (kernel images and /boot directory), and place the rest
of linux anywhere else on the drive. These files can reside in a DOS
partition, or in a tailor-made linux boot partition.
If you cannot use drive translation, *and* your BIOS also restricts you to
entering no more than 1024 cylinders in the geometry field in the CMOS setup,
then you'll have to set it to 1024. As of v3.5 of this driver, Linux will
automatically determine the *real* number of cylinders for fdisk to use,
allowing easy access to the full disk capacity.
Regardless of what you do, all DOS partitions *must* be contained entirely
within the first 1024 logical cylinders. For a 1Gig WD disk drive, here's
a good "half and half" partitioning scheme to start with:
geometry = 2100/16/63
/dev/hda1 from cyl 1 to 992 dos
/dev/hda2 from cyl 993 to 1023 swap
/dev/hda3 from cyl 1024 to 2100 linux
After installing slackware (or whatever), boot from floppy and mount the dos
partition under /dos, and then move the /boot directory to /dos/boot,
and move the /vmlinuz kernel file into /dos/boot. Then create a symlink
to put it back where the filesystem standard wants it: ln -s /dos/boot /boot
Finally, edit /etc/lilo.conf and change the reference to /vmlinuz to point
at /boot/vmlinuz and then re-run lilo. Have Fun. :)
If you "don't do DOS", then partition as you please, but remember to create
a small partition to hold the /boot directory (and vmlinuz) as described above
such that it all lies within the first 1024 cylinders.
Western Digital now ships a "DiskManager 6.03" diskette with all of their big
hard drives. Burn it! That idiotic piece of garbage isn't even universally
compatible with DOS, let alone other operating systems like Linux. Eventually
some kind person will kludge Linux to work with it, but at present the two
are completely incompatible. If you have this version of DiskManager on your
hard disk already, it can be exterminated at the expense of all data on the
drive (back it up elsewhere), by using the "DM" command from the diskette
as follows: DM /Y-
mlord@bnr.ca
......@@ -30,16 +30,25 @@
* These will have to be changed to be aware of different buffer
* sizes etc.. It actually needs a major cleanup.
*/
#ifdef IDE_DRIVER
#define SECTOR_MASK ((BLOCK_SIZE >> 9) - 1)
#else
#define SECTOR_MASK (blksize_size[MAJOR_NR] && \
blksize_size[MAJOR_NR][MINOR(CURRENT->dev)] ? \
((blksize_size[MAJOR_NR][MINOR(CURRENT->dev)] >> 9) - 1) : \
((BLOCK_SIZE >> 9) - 1))
#endif /* IDE_DRIVER */
#define SUBSECTOR(block) (CURRENT->current_nr_sectors > 0)
extern unsigned long hd_init(unsigned long mem_start, unsigned long mem_end);
extern unsigned long cdu31a_init(unsigned long mem_start, unsigned long mem_end);
extern unsigned long mcd_init(unsigned long mem_start, unsigned long mem_end);
#ifdef CONFIG_BLK_DEV_HD
extern unsigned long hd_init(unsigned long mem_start, unsigned long mem_end);
#endif
#ifdef CONFIG_BLK_DEV_IDE
extern unsigned long ide_init(unsigned long mem_start, unsigned long mem_end);
#endif
#ifdef CONFIG_SBPCD
extern unsigned long sbpcd_init(unsigned long, unsigned long);
#endif CONFIG_SBPCD
......@@ -64,14 +73,19 @@ extern unsigned long xd_init(unsigned long mem_start, unsigned long mem_end);
case BLKROGET: { int __err = verify_area(VERIFY_WRITE, (void *) (where), sizeof(long)); \
if (!__err) put_fs_long(0!=is_read_only(dev),(long *) (where)); return __err; }
#ifdef MAJOR_NR
#if defined(MAJOR_NR) || defined(IDE_DRIVER)
/*
* Add entries as needed. Currently the only block devices
* supported are hard-disks and floppies.
* Add entries as needed.
*/
#if (MAJOR_NR == MEM_MAJOR)
#ifdef IDE_DRIVER
#define DEVICE_NR(device) (MINOR(device) >> PARTN_BITS)
#define DEVICE_ON(device) /* nothing */
#define DEVICE_OFF(device) /* nothing */
#elif (MAJOR_NR == MEM_MAJOR)
/* ram disk */
#define DEVICE_NAME "ramdisk"
......@@ -187,9 +201,9 @@ static void floppy_off(unsigned int nr);
#define DEVICE_ON(device)
#define DEVICE_OFF(device)
#endif
#endif /* MAJOR_NR == whatever */
#if (MAJOR_NR != SCSI_TAPE_MAJOR)
#if (MAJOR_NR != SCSI_TAPE_MAJOR) && !defined(IDE_DRIVER)
#ifndef CURRENT
#define CURRENT (blk_dev[MAJOR_NR].current_request)
......@@ -219,23 +233,46 @@ else \
#define SET_INTR(x) (DEVICE_INTR = (x))
#endif
#endif /* DEVICE_TIMEOUT */
static void (DEVICE_REQUEST)(void);
#ifdef DEVICE_INTR
#define CLEAR_INTR SET_INTR(NULL)
#else
#define CLEAR_INTR
#endif
#define INIT_REQUEST \
if (!CURRENT) {\
CLEAR_INTR; \
return; \
} \
if (MAJOR(CURRENT->dev) != MAJOR_NR) \
panic(DEVICE_NAME ": request list destroyed"); \
if (CURRENT->bh) { \
if (!CURRENT->bh->b_lock) \
panic(DEVICE_NAME ": block not locked"); \
}
#endif /* (MAJOR_NR != SCSI_TAPE_MAJOR) && !defined(IDE_DRIVER) */
/* end_request() - SCSI devices have their own version */
#if ! SCSI_MAJOR(MAJOR_NR)
static void end_request(int uptodate)
{
struct request * req;
#ifdef IDE_DRIVER
static void end_request(byte uptodate, byte hwif) {
struct request *req = ide_cur_rq[HWIF];
#else
static void end_request(int uptodate) {
struct request *req = CURRENT;
#endif /* IDE_DRIVER */
struct buffer_head * bh;
req = CURRENT;
req->errors = 0;
if (!uptodate) {
printk(DEVICE_NAME " I/O error\n");
printk("dev %04lX, sector %lu\n",
printk("end_request: I/O error, dev %04lX, sector %lu\n",
(unsigned long)req->dev, req->sector);
req->nr_sectors--;
req->nr_sectors &= ~SECTOR_MASK;
......@@ -259,34 +296,19 @@ static void end_request(int uptodate)
return;
}
}
#ifdef IDE_DRIVER
ide_cur_rq[HWIF] = NULL;
#else
DEVICE_OFF(req->dev);
CURRENT = req->next;
#endif /* IDE_DRIVER */
if (req->sem != NULL)
up(req->sem);
req->dev = -1;
wake_up(&wait_for_request);
}
#endif
#ifdef DEVICE_INTR
#define CLEAR_INTR SET_INTR(NULL)
#else
#define CLEAR_INTR
#endif
#define INIT_REQUEST \
if (!CURRENT) {\
CLEAR_INTR; \
return; \
} \
if (MAJOR(CURRENT->dev) != MAJOR_NR) \
panic(DEVICE_NAME ": request list destroyed"); \
if (CURRENT->bh) { \
if (!CURRENT->bh->b_lock) \
panic(DEVICE_NAME ": block not locked"); \
}
#endif /* ! SCSI_MAJOR(MAJOR_NR) */
#endif
#endif /* defined(MAJOR_NR) || defined(IDE_DRIVER) */
#endif
#endif
#endif /* _BLK_H */
......@@ -14,6 +14,7 @@
#include <linux/fs.h>
#include <linux/genhd.h>
#include <linux/kernel.h>
#include <linux/major.h>
struct gendisk *gendisk_head = NULL;
......@@ -22,6 +23,19 @@ extern int *blk_size[];
extern void rd_load(void);
extern int ramdisk_size;
static char minor_name (struct gendisk *hd, int minor)
{
char base_name = (hd->major == IDE1_MAJOR) ? 'c' : 'a';
return base_name + (minor >> hd->minor_shift);
}
static void add_partition (struct gendisk *hd, int minor, int start, int size)
{
hd->part[minor].start_sect = start;
hd->part[minor].nr_sects = size;
printk(" %s%c%d", hd->major_name, minor_name(hd, minor),
minor & ((1 << hd->minor_shift) - 1));
}
/*
* Create devices for each logical partition in an extended partition.
* The logical partitions form a linked list, with each entry being
......@@ -61,13 +75,9 @@ static void extended_partition(struct gendisk *hd, int dev)
* Process the first entry, which should be the real
* data partition.
*/
if (p->sys_ind == EXTENDED_PARTITION ||
!(hd->part[current_minor].nr_sects = p->nr_sects))
if (p->sys_ind == EXTENDED_PARTITION || !p->nr_sects)
goto done; /* shouldn't happen */
hd->part[current_minor].start_sect = this_sector + p->start_sect;
printk(" %s%c%d", hd->major_name,
'a'+(current_minor >> hd->minor_shift),
mask & current_minor);
add_partition(hd, current_minor, this_sector+p->start_sect, p->nr_sects);
current_minor++;
p++;
/*
......@@ -104,19 +114,28 @@ static void check_partition(struct gendisk *hd, unsigned int dev)
printk("Partition check:\n");
first_time = 0;
first_sector = hd->part[MINOR(dev)].start_sect;
/*
* This is a kludge to allow the partition check to be
* skipped for specific drives (ie. IDE cd-rom drives)
*/
if ((int)first_sector == -1) {
hd->part[MINOR(dev)].start_sect = 0;
return;
}
if (!(bh = bread(dev,0,1024))) {
printk(" unable to read partition table of device %04x\n",dev);
return;
}
printk(" %s%c:", hd->major_name, 'a'+(minor >> hd->minor_shift));
current_minor += 4; /* first "extra" minor */
printk(" %s%c:", hd->major_name, minor_name(hd, minor));
current_minor += 4; /* first "extra" minor (for extended partitions) */
if (*(unsigned short *) (bh->b_data+510) == 0xAA55) {
p = (struct partition *) (0x1BE + bh->b_data);
for (i=1 ; i<=4 ; minor++,i++,p++) {
if (!(hd->part[minor].nr_sects = p->nr_sects))
if (!p->nr_sects)
continue;
hd->part[minor].start_sect = first_sector + p->start_sect;
printk(" %s%c%d", hd->major_name,'a'+(minor >> hd->minor_shift), i);
add_partition(hd, minor, first_sector+p->start_sect, p->nr_sects);
if ((current_minor & 0x3f) >= 60)
continue;
if (p->sys_ind == EXTENDED_PARTITION) {
......@@ -136,11 +155,7 @@ static void check_partition(struct gendisk *hd, unsigned int dev)
break;
if (!(p->start_sect && p->nr_sects))
continue;
hd->part[current_minor].start_sect = p->start_sect;
hd->part[current_minor].nr_sects = p->nr_sects;
printk(" %s%c%d", hd->major_name,
'a'+(current_minor >> hd->minor_shift),
current_minor & mask);
add_partition(hd, current_minor, p->start_sect, p->nr_sects);
}
}
} else
......
/*
* linux/kernel/hd.c
* linux/drivers/block/hd.c
*
* Copyright (C) 1991, 1992 Linus Torvalds
*/
......@@ -836,14 +836,6 @@ static int hd_ioctl(struct inode * inode, struct file * file,
case BLKRRPART: /* Re-read partition tables */
return revalidate_hddisk(inode->i_rdev, 1);
case HDIO_SETUNMASKINTR: /* obsolete */
printk("hd: obsolete syscall: HDIO_SETUNMASKINTR\n");
if (!arg) return -EINVAL;
err = verify_area(VERIFY_READ, (long *) arg, sizeof(long));
if (err)
return err;
arg = get_fs_long((long *) arg);
/* drop into HDIO_SET_UNMASKINTR */
case HDIO_SET_UNMASKINTR:
if (!suser()) return -EACCES;
if ((arg > 1) || (MINOR(inode->i_rdev) & 0x3F))
......@@ -867,14 +859,6 @@ static int hd_ioctl(struct inode * inode, struct file * file,
put_fs_long(mult_count[dev], (long *) arg);
return 0;
case HDIO_SETMULTCOUNT: /* obsolete */
printk("hd: obsolete syscall: HDIO_SETMULTCOUNT\n");
if (!arg) return -EINVAL;
err = verify_area(VERIFY_READ, (long *) arg, sizeof(long));
if (err)
return err;
arg = get_fs_long((long *) arg);
/* drop into HDIO_SET_MULTCOUNT */
case HDIO_SET_MULTCOUNT:
if (!suser()) return -EACCES;
if (MINOR(inode->i_rdev) & 0x3F) return -EINVAL;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -209,8 +209,8 @@ void rd_load(void)
/* If no RAM disk specified, give up early. */
if (!rd_length)
return;
printk("RAMDISK: %d bytes, starting at 0x%x\n",
rd_length, (int) rd_start);
printk("RAMDISK: %d bytes, starting at 0x%p\n",
rd_length, rd_start);
/* If we are doing a diskette boot, we might have to pre-load it. */
if (MAJOR(ROOT_DEV) != FLOPPY_MAJOR)
......
Thu Dec 29 17:53:48 1994 <tytso@rsx-11.mit.edu>
* tty_io.c (check_tty_count): New procedure which checks
tty->count to make sure that it matches with the number of
open file descriptors which point at the structure. If
the number doesn't match, it prints a warning message.
Wed Dec 28 15:41:51 1994 <tytso@rsx-11.mit.edu>
* tty_io.c (do_tty_hangup, disassociate_ctty): At hangup time,
save the tty's current foreground process group in the
session leader's task structure. When the session leader
terminates, send a SIGHUP, SIGCONT to that process group.
This is not required by POSIX, but it's not prohibited
either, and it appears to be the least intrusive way
to fix a problem that dialup servers have with
orphaned process groups caused by modem hangups.
Thu Dec 8 14:52:11 1994 <tytso@rsx-11.mit.edu>
* serial.c (rs_ioctl): Don't allow most ioctl's if the serial port
......
......@@ -18,11 +18,11 @@
OBJS = tty_io.o n_tty.o console.o keyboard.o serial.o \
tty_ioctl.o pty.o vt.o mem.o \
defkeymap.o uni_to_437.o
defkeymap.o uni_to_437.o vesa_blank.o
SRCS = tty_io.c n_tty.c console.c keyboard.c serial.c \
tty_ioctl.c pty.c vt.c mem.c \
defkeymap.c uni_to_437.c
defkeymap.c uni_to_437.c vesa_blank.c
ifdef CONFIG_CYCLADES
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment