diff -ur linux-109/Makefile linux/Makefile --- linux-109/Makefile Sun Feb 15 12:31:59 1998 +++ linux/Makefile Wed Mar 18 18:05:49 1998 @@ -10,6 +10,8 @@ else if [ -x /bin/bash ]; then echo /bin/bash; \ else echo sh; fi ; fi) +TOPDIR := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi) + # # Make "config" the default target if there is no configuration file or # "depend" the target if there is no top-level dependency information. @@ -50,7 +52,7 @@ # standard CFLAGS # -CFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -pipe +CFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -malign-loops=0 -malign-jumps=0 -malign-functions=0 -pipe ifdef CONFIG_CPP CFLAGS := $(CFLAGS) -x c++ @@ -72,26 +74,62 @@ AS86 =as86 -0 -a LD86 =ld86 -0 -AS =as -LD =ld -LDFLAGS =#-qmagic -HOSTCC =gcc -CC =gcc -D__KERNEL__ +CC =gcc -I$(TOPDIR)/include +HOSTCC =gcc MAKE =make CPP =$(CC) -E AR =ar STRIP =strip +# We use ELF. +# +USE_ELF=yes +# +# We use a.out. +#USE_ELF=no + +# ZLINKFLAGS = -Ttext 0x1000 +# LINKFLAGS = -Ttext 0x100000 +# +# +ifeq ($(USE_ELF),yes) +LD=ld -m elf_i386 +ELF=-D__ELF__ +CPP=$(CC) -E $(ELF) +OBJCOPY =objcopy -O binary -R .note -R .comment -R .stab -R .stabstr +OBJDUMP =objdump +ENCAPS =encaps +CFLAGS := $(CFLAGS) -D__KERNEL__ +OBJDUMP_FLAGS=-k -q +LDFLAGS=-e startup_32 +ZIMAGE_OFFSET=0x1000 +IMAGE_OFFSET=0x100000 +ZLINKFLAGS =-Ttext $(ZIMAGE_OFFSET) $(LDFLAGS) +LINKFLAGS =-Ttext $(IMAGE_OFFSET) $(LDFLAGS) +TOOLFLAGS = -D__BFD__ +else +AS=/usr/i486-linuxaout/bin/as +LD=/usr/i486-linuxaout/bin/ld -m i386linux +CC=gcc -b i486-linuxaout -D__KERNEL__ -I$(TOPDIR)/include +# +# -qmagic (we need to remove the 32 byte header for bootup purposes) +# +ZLINKFLAGS =-qmagic -Ttext 0xfe0 +LINKFLAGS =-qmagic -Ttext 0xfffe0 +TOOLFLAGS = +endif + ARCHIVES =kernel/kernel.o mm/mm.o fs/fs.o net/net.o ipc/ipc.o FILESYSTEMS =fs/filesystems.a DRIVERS =drivers/block/block.a \ drivers/char/char.a \ - drivers/net/net.a \ ibcs/ibcs.o LIBS =lib/lib.a SUBDIRS =kernel drivers mm fs net ipc ibcs lib -KERNELHDRS =/usr/src/linux/include +ifdef CONFIG_INET +DRIVERS := $(DRIVERS) drivers/net/net.a +endif ifdef CONFIG_SCSI DRIVERS := $(DRIVERS) drivers/scsi/scsi.a @@ -108,7 +146,7 @@ .c.s: $(CC) $(CFLAGS) -S -o $*.s $< .s.o: - $(AS) -c -o $*.o $< + $(AS) -o $*.o $< .c.o: $(CC) $(CFLAGS) -c -o $*.o $< @@ -134,10 +172,10 @@ @echo \#define LINUX_COMPILE_TIME \"`date +%T`\" >> tools/version.h @echo \#define LINUX_COMPILE_BY \"`whoami`\" >> tools/version.h @echo \#define LINUX_COMPILE_HOST \"`hostname`\" >> tools/version.h - @echo \#define LINUX_COMPILE_DOMAIN \"`domainname`\" >> tools/version.h + @echo \#define LINUX_COMPILE_DOMAIN \"`hostname -d`\" >> tools/version.h tools/build: tools/build.c $(CONFIGURE) - $(HOSTCC) $(CFLAGS) -o $@ $< + $(HOSTCC) $(CFLAGS) $(TOOLFLAGS) -o $@ $< boot/head.o: $(CONFIGURE) boot/head.s @@ -149,14 +187,14 @@ init/main.o: $(CONFIGURE) init/main.c $(CC) $(CFLAGS) $(PROFILING) -c -o $*.o $< -tools/system: boot/head.o init/main.o tools/version.o linuxsubdirs +tools/System: boot/head.o init/main.o tools/version.o linuxsubdirs $(LD) $(LDFLAGS) -Ttext 1000 boot/head.o init/main.o tools/version.o \ $(ARCHIVES) \ $(FILESYSTEMS) \ $(DRIVERS) \ $(LIBS) \ - -o tools/system - nm tools/zSystem | grep -v '\(compiled\)\|\(\.o$$\)\|\( a \)' | \ + -o tools/System + nm tools/System | grep -v '\(compiled\)\|\(\.o$$\)\|\( a \)' | \ sort > System.map boot/setup: boot/setup.o @@ -180,13 +218,45 @@ zBoot/zSystem: zBoot/*.c zBoot/*.S tools/zSystem $(MAKE) -C zBoot +Image: $(CONFIGURE) boot/bootsect boot/setup tools/System tools/build +ifeq ($(USE_ELF),yes) + if hash $(ENCAPS) 2> /dev/null; then \ + $(OBJDUMP) $(OBJDUMP_FLAGS) -o $(ZIMAGE_OFFSET) tools/System > tools/vmlinux.out ; \ + else \ + $(OBJCOPY) tools/System tools/vmlinux.out; \ + fi + tools/build boot/bootsect boot/setup tools/vmlinux.out $(ROOT_DEV) > Image +else + tools/build boot/bootsect boot/setup tools/System $(ROOT_DEV) > Image +endif + sync + zImage: $(CONFIGURE) boot/bootsect boot/setup zBoot/zSystem tools/build +ifeq ($(USE_ELF),yes) + if hash $(ENCAPS) 2> /dev/null; then \ + $(OBJDUMP) $(OBJDUMP_FLAGS) -o $(ZIMAGE_OFFSET) zBoot/zSystem > zBoot/vmlinux.out ; \ + else \ + $(OBJCOPY) zBoot/zSystem zBoot/vmlinux.out; \ + fi + tools/build boot/bootsect boot/setup zBoot/vmlinux.out $(ROOT_DEV) > zImage +else tools/build boot/bootsect boot/setup zBoot/zSystem $(ROOT_DEV) > zImage +endif sync +disk: Image + dd bs=8192 if=Image of=/dev/fd0 + zdisk: zImage dd bs=8192 if=zImage of=/dev/fd0 +lilo: $(CONFIGURE) Image + if [ -f /vmlinux ]; then mv /vmlinux /vmlinux.old; fi + if [ -f /System.map ]; then mv /System.map /System.old; fi + cat Image > /vmlinux + cp System.map / + if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi + zlilo: $(CONFIGURE) zImage if [ -f /vmlinuz ]; then mv /vmlinuz /vmlinuz.old; fi if [ -f /zSystem.map ]; then mv /zSystem.map /zSystem.old; fi @@ -229,9 +299,9 @@ 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 boot/bootsect boot/setup - rm -f zBoot/zSystem zBoot/xtract zBoot/piggyback + rm -f zImage zSystem.map tools/zSystem tools/System + rm -f Image System.map boot/bootsect boot/setup tools/vmlinux.out + rm -f zBoot/zSystem zBoot/xtract zBoot/piggyback zBoot/vmlinux.out rm -f .tmp* drivers/sound/configure rm -f init/*.o tools/build boot/*.o tools/*.o @@ -274,26 +344,3 @@ endif -# -# 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 - -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 diff -ur linux-109/boot/head.S linux/boot/head.S --- linux-109/boot/head.S Thu Feb 3 21:37:44 1994 +++ linux/boot/head.S Mon Feb 16 18:49:58 1998 @@ -9,14 +9,10 @@ */ .text -.globl _idt,_gdt, -.globl _swapper_pg_dir,_pg0 -.globl _empty_bad_page -.globl _empty_bad_page_table -.globl _empty_zero_page -.globl _tmp_floppy_area,_floppy_track_buffer +#include #include +#include #include #define CL_MAGIC_ADDR 0x90020 @@ -28,6 +24,7 @@ * swapper_pg_dir is the main page directory, address 0x00001000 (or at * address 0x00101000 for a compressed boot). */ + .globl startup_32 startup_32: cld movl $(KERNEL_DS),%eax @@ -35,13 +32,13 @@ mov %ax,%es mov %ax,%fs mov %ax,%gs - lss _stack_start,%esp + lss SYMBOL_NAME(stack_start),%esp /* * Clear BSS first so that there are no surprises... */ xorl %eax,%eax - movl $__edata,%edi - movl $__end,%ecx + movl $ SYMBOL_NAME(_edata),%edi + movl $ SYMBOL_NAME(_end),%ecx subl %edi,%ecx cld rep @@ -69,7 +66,7 @@ * is for the command line. */ movl $0x90000,%esi - movl $_empty_zero_page,%edi + movl $ SYMBOL_NAME(empty_zero_page),%edi movl $512,%ecx cld rep @@ -80,7 +77,7 @@ stosl cmpw $(CL_MAGIC),CL_MAGIC_ADDR jne 1f - movl $_empty_zero_page+2048,%edi + movl $ SYMBOL_NAME(empty_zero_page)+2048,%edi movzwl CL_OFFSET,%esi addl $(CL_BASE_ADDR),%esi movl $2048,%ecx @@ -95,7 +92,7 @@ */ movl %esp,%edi # save stack pointer andl $0xfffffffc,%esp # align stack to avoid AC fault - movl $3,_x86 + movl $3,SYMBOL_NAME(x86) pushfl # push EFLAGS popl %eax # get EFLAGS movl %eax,%ecx # save original EFLAGS @@ -107,7 +104,7 @@ xorl %ecx,%eax # change in flags andl $0x40000,%eax # check if AC bit changed je is386 - movl $4,_x86 + movl $4,SYMBOL_NAME(x86) movl %ecx,%eax xorl $0x200000,%eax # check ID flag pushl %eax @@ -123,7 +120,7 @@ .byte 0x0f, 0xa2 # check the processor type andl $0xf00, %eax # Set _x86 with the family shrl $8, %eax # returned. - movl %eax, _x86 + movl %eax, SYMBOL_NAME(x86) movl %edi,%esp # restore esp movl %cr0,%eax # 486+ andl $0x80000011,%eax # Save PG,PE,ET @@ -153,14 +150,14 @@ mov %ax,%es mov %ax,%fs mov %ax,%gs - lss _stack_start,%esp + lss SYMBOL_NAME(stack_start),%esp xorl %eax,%eax lldt %ax pushl %eax # These are the parameters to main :-) pushl %eax pushl %eax cld # gcc2 wants the direction flag cleared at all times - call _start_kernel + call SYMBOL_NAME(start_kernel) L6: jmp L6 # main should never return here, but # just in case, we know what happens. @@ -169,7 +166,7 @@ * We depend on ET to be correct. This checks for 287/387. */ check_x87: - movl $0,_hard_math + movl $0,SYMBOL_NAME(hard_math) clts fninit fstsw %ax @@ -180,7 +177,7 @@ movl %eax,%cr0 ret .align 2 -1: movl $1,_hard_math +1: movl $1,SYMBOL_NAME(hard_math) .byte 0xDB,0xE4 /* fsetpm for 287, ignored by 387 */ ret @@ -200,7 +197,7 @@ movw %dx,%ax /* selector = 0x0010 = cs */ movw $0x8E00,%dx /* interrupt gate - dpl=0, present */ - lea _idt,%edi + lea SYMBOL_NAME(idt),%edi mov $256,%ecx rp_sidt: movl %eax,(%edi) @@ -222,24 +219,26 @@ * (ref: update, 25Sept92) -- croutons@crunchy.uucp * (ref: 92.10.11 - Linus Torvalds. Corrected 16M limit - no upper memory limit) */ -.align 2 + ALIGN setup_paging: movl $1024*2,%ecx /* 2 pages - swapper_pg_dir+1 page table */ xorl %eax,%eax - movl $_swapper_pg_dir,%edi /* swapper_pg_dir is at 0x1000 */ + movl $ SYMBOL_NAME(swapper_pg_dir),%edi /* swapper_pg_dir is at 0x1000 */ cld;rep;stosl /* Identity-map the kernel in low 4MB memory for ease of transition */ - movl $_pg0+7,_swapper_pg_dir /* set present bit/user r/w */ +/* set present bit/user r/w */ + movl $ SYMBOL_NAME(pg0)+7,SYMBOL_NAME(swapper_pg_dir) /* But the real place is at 0xC0000000 */ - movl $_pg0+7,_swapper_pg_dir+3072 /* set present bit/user r/w */ - movl $_pg0+4092,%edi +/* set present bit/user r/w */ + movl $ SYMBOL_NAME(pg0)+7,SYMBOL_NAME(swapper_pg_dir)+3072 + movl $ SYMBOL_NAME(pg0)+4092,%edi movl $0x03ff007,%eax /* 4Mb - 4096 + 7 (r/w user,p) */ std 1: stosl /* fill the page backwards - more efficient :-) */ subl $0x1000,%eax jge 1b cld - movl $_swapper_pg_dir,%eax + movl $ SYMBOL_NAME(swapper_pg_dir),%eax movl %eax,%cr3 /* cr3 - page directory start */ movl %cr0,%eax orl $0x80000000,%eax @@ -257,30 +256,31 @@ * by 2-3k. This would be a good thing to do at some point..... */ .org 0x1000 -_swapper_pg_dir: +ENTRY(swapper_pg_dir) /* * The page tables are initialized to only 4MB here - the final page * tables are set up later depending on memory size. */ .org 0x2000 -_pg0: +ENTRY(pg0) .org 0x3000 -_empty_bad_page: +ENTRY(empty_bad_page) .org 0x4000 -_empty_bad_page_table: +ENTRY(empty_bad_page_table) .org 0x5000 -_empty_zero_page: +ENTRY(empty_zero_page) .org 0x6000 +#ifdef CONFIG_BLK_DEV_FD /* * tmp_floppy_area is used by the floppy-driver when DMA cannot * reach to a buffer-block. It needs to be aligned, so that it isn't * on a 64kB border. */ -_tmp_floppy_area: +ENTRY(tmp_floppy_area) .fill 1024,1,0 /* * floppy_track_buffer is used to buffer one track of floppy data: it @@ -288,8 +288,9 @@ * sector read/write can mess it up. It can contain one full track of * data (18*2*512 bytes). */ -_floppy_track_buffer: +ENTRY(floppy_track_buffer) .fill 512*2*18,1,0 +#endif /* This is the default interrupt "handler" :-) */ int_msg: @@ -308,7 +309,7 @@ mov %ax,%es mov %ax,%fs pushl $int_msg - call _printk + call SYMBOL_NAME(printk) popl %eax pop %fs pop %es @@ -321,28 +322,26 @@ /* * The interrupt descriptor table has room for 256 idt's */ -.align 4 + ALIGN .word 0 idt_descr: .word 256*8-1 # idt contains 256 entries - .long 0xc0000000+_idt + .long 0xc0000000+SYMBOL_NAME(idt) -.align 4 -_idt: +ENTRY(idt) .fill 256,8,0 # idt is uninitialized -.align 4 + ALIGN .word 0 gdt_descr: .word (8+2*NR_TASKS)*8-1 - .long 0xc0000000+_gdt + .long 0xc0000000+SYMBOL_NAME(gdt) /* * This gdt setup gives the kernel a 1GB address space at virtual * address 0xC0000000 - space enough for expansion, I hope. */ -.align 4 -_gdt: +ENTRY(gdt) .quad 0x0000000000000000 /* NULL descriptor */ .quad 0x0000000000000000 /* not used */ .quad 0xc0c39a000000ffff /* 0x10 kernel 1GB code at 0xC0000000 */ diff -ur linux-109/config.in linux/config.in --- linux-109/config.in Sun Feb 15 12:31:52 1998 +++ linux/config.in Wed Mar 18 16:17:44 1998 @@ -5,18 +5,22 @@ * * General setup * -bool 'Kernel math emulation' CONFIG_MATH_EMULATION y +bool 'Kernel math emulation' CONFIG_MATH_EMULATION n bool 'Normal harddisk support' CONFIG_BLK_DEV_HD y +bool 'Floppy disk support' CONFIG_BLK_DEV_FD y +bool 'RAM disk support' CONFIG_BLK_DEV_RAM n bool 'XT harddisk support' CONFIG_BLK_DEV_XD n bool 'TCP/IP networking' CONFIG_INET y bool 'Limit memory to low 16MB' CONFIG_MAX_16M n bool 'System V IPC' CONFIG_SYSVIPC y -bool 'Use -m486 flag for 486-specific optimizations' CONFIG_M486 y +bool 'Use -m486 flag for 486-specific optimizations' CONFIG_M486 n +bool 'Loadable Module support' CONFIG_MODULES n * * Program binary formats * -bool 'Elf executables' CONFIG_BINFMT_ELF y -bool 'COFF executables' CONFIG_BINFMT_COFF y +bool 'ELF executables' CONFIG_BINFMT_ELF y +bool 'a.out executables' CONFIG_BINFMT_AOUT n +bool 'COFF executables' CONFIG_BINFMT_COFF n * * SCSI support * @@ -56,15 +60,15 @@ : Skipping ethercard configuration options... : else -bool 'SLIP (serial line) support' CONFIG_SLIP n +bool 'SLIP (serial line) support' CONFIG_SLIP y if [ "$CONFIG_SLIP" = "y" ] - bool ' CSLIP compressed headers' SL_COMPRESSED y +bool ' CSLIP compressed headers' SL_COMPRESSED y # bool ' SLIP debugging on' SL_DUMP y fi #bool 'PPP (point-to-point) support' CONFIG_PPP n bool 'PLIP (parallel port) support' CONFIG_PLIP n bool 'NE2000/NE1000 support' CONFIG_NE2000 n -bool 'WD80*3 support' CONFIG_WD80x3 y +bool 'WD80*3 support' CONFIG_WD80x3 n bool 'SMC Ultra support' CONFIG_ULTRA n bool '3c501 support' CONFIG_EL1 n bool '3c503 support' CONFIG_EL2 n @@ -91,28 +95,29 @@ * * Filesystems * -bool 'Standard (minix) fs support' CONFIG_MINIX_FS y +bool 'Standard (minix) fs support' CONFIG_MINIX_FS n bool 'Extended fs support' CONFIG_EXT_FS n bool 'Second extended fs support' CONFIG_EXT2_FS y bool 'xiafs filesystem support' CONFIG_XIA_FS n bool 'msdos fs support' CONFIG_MSDOS_FS y bool '/proc filesystem support' CONFIG_PROC_FS y -bool 'NFS filesystem support' CONFIG_NFS_FS y +bool 'NFS filesystem support' CONFIG_NFS_FS n bool 'ISO9660 cdrom filesystem support' CONFIG_ISO9660_FS n bool 'OS/2 HPFS filesystem support (read only)' CONFIG_HPFS_FS n bool 'System V and Coherent filesystem support' CONFIG_SYSV_FS n * * character devices * -bool 'Parallel printer support' CONFIG_PRINTER n +bool 'Serial device support' CONFIG_SERIAL y +bool 'Parallel printer support' CONFIG_PRINTER y bool 'Logitech busmouse support' CONFIG_BUSMOUSE n bool 'PS/2 mouse (aka "auxiliary device") support' CONFIG_PSMOUSE y if [ "$CONFIG_PSMOUSE" = "y" ] -bool 'C&T 82C710 mouse port support (as on TI Travelmate)' CONFIG_82C710_MOUSE y +bool 'C&T 82C710 mouse port support (as on TI Travelmate)' CONFIG_82C710_MOUSE n 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 'Selection (cut and paste for virtual consoles)' CONFIG_SELECTION y bool 'QIC-02 tape support' CONFIG_TAPE_QIC02 n bool 'QIC-117 tape support' CONFIG_FTAPE n if [ "$CONFIG_FTAPE" = "y" ] diff -ur linux-109/drivers/FPU-emu/Makefile linux/drivers/FPU-emu/Makefile --- linux-109/drivers/FPU-emu/Makefile Tue Jan 11 20:10:47 1994 +++ linux/drivers/FPU-emu/Makefile Sun Feb 15 12:46:22 1998 @@ -12,7 +12,7 @@ $(CC) $(CFLAGS) $(MATH_EMULATION) -c $< .S.o: - $(CC) -D__ASSEMBLER__ $(PARANOID) $(REENTRANT) -c $< + $(CC) -D__ASSEMBLER__ $(ELF) $(PARANOID) $(REENTRANT) -c $< .s.o: $(CC) -c $< diff -ur linux-109/drivers/FPU-emu/div_small.S linux/drivers/FPU-emu/div_small.S --- linux-109/drivers/FPU-emu/div_small.S Wed Dec 1 23:44:16 1993 +++ linux/drivers/FPU-emu/div_small.S Sun Feb 15 12:46:22 1998 @@ -17,11 +17,8 @@ #include "fpu_asm.h" .text - .align 2,144 -.globl _div_small - -_div_small: +ENTRY(div_small) pushl %ebp movl %esp,%ebp diff -ur linux-109/drivers/FPU-emu/fpu_asm.h linux/drivers/FPU-emu/fpu_asm.h --- linux-109/drivers/FPU-emu/fpu_asm.h Wed Dec 1 23:44:16 1993 +++ linux/drivers/FPU-emu/fpu_asm.h Sun Feb 15 12:46:22 1998 @@ -9,9 +9,10 @@ #ifndef _FPU_ASM_H_ #define _FPU_ASM_H_ +#include #include "fpu_emu.h" -#define EXCEPTION _exception +#define EXCEPTION SYMBOL_NAME(exception) #define PARAM1 8(%ebp) diff -ur linux-109/drivers/FPU-emu/poly_div.S linux/drivers/FPU-emu/poly_div.S --- linux-109/drivers/FPU-emu/poly_div.S Wed Dec 1 23:44:16 1993 +++ linux/drivers/FPU-emu/poly_div.S Sun Feb 15 12:46:22 1998 @@ -19,9 +19,7 @@ .text /*---------------------------------------------------------------------------*/ - .align 2,144 -.globl _poly_div2 -_poly_div2: +ENTRY(poly_div2) pushl %ebp movl %esp,%ebp @@ -41,9 +39,7 @@ leave ret /*---------------------------------------------------------------------------*/ - .align 2,144 -.globl _poly_div4 -_poly_div4: +ENTRY(poly_div4) pushl %ebp movl %esp,%ebp @@ -68,9 +64,7 @@ leave ret /*---------------------------------------------------------------------------*/ - .align 2,144 -.globl _poly_div16 -_poly_div16: +ENTRY(poly_div16) pushl %ebp movl %esp,%ebp diff -ur linux-109/drivers/FPU-emu/poly_mul64.S linux/drivers/FPU-emu/poly_mul64.S --- linux-109/drivers/FPU-emu/poly_mul64.S Wed Dec 1 23:44:16 1993 +++ linux/drivers/FPU-emu/poly_mul64.S Sun Feb 15 12:46:22 1998 @@ -15,9 +15,7 @@ #include "fpu_asm.h" .text - .align 2,144 -.globl _mul64 -_mul64: +ENTRY(mul64) pushl %ebp movl %esp,%ebp subl $16,%esp diff -ur linux-109/drivers/FPU-emu/polynomial.S linux/drivers/FPU-emu/polynomial.S --- linux-109/drivers/FPU-emu/polynomial.S Wed Dec 1 23:44:16 1993 +++ linux/drivers/FPU-emu/polynomial.S Sun Feb 15 12:46:22 1998 @@ -35,9 +35,7 @@ #define ACCUM_LS_HI -9(%ebp) /* high byte of accum ls */ .text - .align 2,144 -.globl _polynomial -_polynomial: +ENTRY(polynomial) pushl %ebp movl %esp,%ebp subl $32,%esp diff -ur linux-109/drivers/FPU-emu/reg_div.S linux/drivers/FPU-emu/reg_div.S --- linux-109/drivers/FPU-emu/reg_div.S Thu Feb 3 21:11:40 1994 +++ linux/drivers/FPU-emu/reg_div.S Sun Feb 15 12:46:22 1998 @@ -19,10 +19,7 @@ .text - .align 2 - -.globl _reg_div -_reg_div: +ENTRY(reg_div) pushl %ebp movl %esp,%ebp #ifdef REENTRANT_FPU @@ -47,7 +44,7 @@ cmpl EXP_UNDER,EXP(%esi) jg xL_arg1_not_denormal - call _denormal_operand + call SYMBOL_NAME(denormal_operand) orl %eax,%eax jnz fpu_Arith_exit @@ -55,7 +52,7 @@ cmpl EXP_UNDER,EXP(%ebx) jg xL_arg2_not_denormal - call _denormal_operand + call SYMBOL_NAME(denormal_operand) orl %eax,%eax jnz fpu_Arith_exit @@ -75,7 +72,7 @@ addl EXP_BIAS,%edx movl %edx,EXP(%edi) - jmp _divide_kernel + jmp SYMBOL_NAME(divide_kernel) /*-----------------------------------------------------------------------*/ @@ -92,14 +89,14 @@ pushl %edi /* Destination */ pushl %esi pushl %ebx /* Ordering is important here */ - call _real_2op_NaN + call SYMBOL_NAME(real_2op_NaN) jmp LDiv_exit /* Invalid operations */ L_zero_zero: L_inf_inf: pushl %edi /* Destination */ - call _arith_invalid /* 0/0 or Infinity/Infinity */ + call SYMBOL_NAME(arith_invalid) /* 0/0 or Infinity/Infinity */ jmp LDiv_exit L_no_NaN_arg: @@ -126,7 +123,7 @@ cmpl EXP_UNDER,EXP(%ebx) jg L_copy_arg1 /* Answer is Inf */ - call _denormal_operand + call SYMBOL_NAME(denormal_operand) orl %eax,%eax jnz fpu_Arith_exit #endif DENORM_OPERAND @@ -151,7 +148,7 @@ movb SIGN(%esi),%al xorb SIGN(%ebx),%al pushl %eax /* lower 8 bits have the sign */ - call _divide_by_zero + call SYMBOL_NAME(divide_by_zero) jmp LDiv_exit L_arg2_not_zero: @@ -165,7 +162,7 @@ cmpl EXP_UNDER,EXP(%esi) jg L_return_zero /* Answer is zero */ - call _denormal_operand + call SYMBOL_NAME(denormal_operand) orl %eax,%eax jnz fpu_Arith_exit #endif DENORM_OPERAND @@ -185,7 +182,7 @@ cmpl EXP_UNDER,EXP(%ebx) jg L_copy_arg1 /* Answer is zero */ - call _denormal_operand + call SYMBOL_NAME(denormal_operand) orl %eax,%eax jnz fpu_Arith_exit #endif DENORM_OPERAND @@ -241,11 +238,11 @@ call EXCEPTION /* Generate a NaN for unknown tags */ - movl _CONST_QNaN,%eax + movl SYMBOL_NAME(CONST_QNaN),%eax movl %eax,(%edi) - movl _CONST_QNaN+4,%eax + movl SYMBOL_NAME(CONST_QNaN)+4,%eax movl %eax,SIGL(%edi) - movl _CONST_QNaN+8,%eax + movl SYMBOL_NAME(CONST_QNaN)+8,%eax movl %eax,SIGH(%edi) jmp LDiv_exit /* %eax is nz */ #endif PARANOID diff -ur linux-109/drivers/FPU-emu/reg_norm.S linux/drivers/FPU-emu/reg_norm.S --- linux-109/drivers/FPU-emu/reg_norm.S Tue Jan 11 20:10:49 1994 +++ linux/drivers/FPU-emu/reg_norm.S Sun Feb 15 12:46:22 1998 @@ -19,10 +19,7 @@ .text - .align 2,144 -.globl _normalize - -_normalize: +ENTRY(normalize) pushl %ebp movl %esp,%ebp pushl %ebx @@ -34,7 +31,7 @@ je L_ok pushl $0x220 - call _exception + call SYMBOL_NAME(exception) addl $4,%esp L_ok: @@ -86,23 +83,21 @@ L_underflow: push %ebx - call _arith_underflow + call SYMBOL_NAME(arith_underflow) pop %ebx jmp L_exit L_overflow: push %ebx - call _arith_overflow + call SYMBOL_NAME(arith_overflow) pop %ebx jmp L_exit /* Normalise without reporting underflow or overflow */ - .align 2,144 -.globl _normalize_nuo -_normalize_nuo: +ENTRY(normalize_nuo) pushl %ebp movl %esp,%ebp pushl %ebx @@ -114,7 +109,7 @@ je L_ok_nuo pushl $0x221 - call _exception + call SYMBOL_NAME(exception) addl $4,%esp L_ok_nuo: diff -ur linux-109/drivers/FPU-emu/reg_round.S linux/drivers/FPU-emu/reg_round.S --- linux-109/drivers/FPU-emu/reg_round.S Wed Feb 16 22:07:57 1994 +++ linux/drivers/FPU-emu/reg_round.S Sun Feb 15 12:46:22 1998 @@ -101,14 +101,13 @@ .text - .align 2,144 + .globl fpu_reg_round .globl fpu_reg_round_sqrt .globl fpu_Arith_exit -.globl _round_reg /* Entry point when called from C */ -_round_reg: +ENTRY(round_reg) pushl %ebp movl %esp,%ebp pushl %esi @@ -435,7 +434,7 @@ */ xL_precision_lost_up: push %eax - call _set_precision_flag_up + call SYMBOL_NAME(set_precision_flag_up) popl %eax jmp xL_no_precision_loss @@ -445,7 +444,7 @@ */ xL_precision_lost_down: push %eax - call _set_precision_flag_down + call SYMBOL_NAME(set_precision_flag_down) popl %eax jmp xL_no_precision_loss @@ -598,7 +597,7 @@ /* There must be a masked underflow */ push %eax pushl EX_Underflow - call _exception + call SYMBOL_NAME(exception) popl %eax popl %eax jmp xL_Normalised @@ -610,12 +609,12 @@ */ L_underflow_to_zero: push %eax - call _set_precision_flag_down + call SYMBOL_NAME(set_precision_flag_down) popl %eax push %eax pushl EX_Underflow - call _exception + call SYMBOL_NAME(exception) popl %eax popl %eax @@ -628,7 +627,7 @@ /* The operations resulted in a number too large to represent. */ L_overflow: push %edi - call _arith_overflow + call SYMBOL_NAME(arith_overflow) pop %edi jmp fpu_reg_round_exit diff -ur linux-109/drivers/FPU-emu/reg_u_add.S linux/drivers/FPU-emu/reg_u_add.S --- linux-109/drivers/FPU-emu/reg_u_add.S Wed Dec 1 23:44:16 1993 +++ linux/drivers/FPU-emu/reg_u_add.S Sun Feb 15 12:46:22 1998 @@ -29,9 +29,7 @@ #include "control_w.h" .text - .align 2,144 -.globl _reg_u_add -_reg_u_add: +ENTRY(reg_u_add) pushl %ebp movl %esp,%ebp pushl %esi @@ -45,7 +43,7 @@ cmpl EXP_UNDER,EXP(%esi) jg xOp1_not_denorm - call _denormal_operand + call SYMBOL_NAME(denormal_operand) orl %eax,%eax jnz fpu_Arith_exit @@ -53,7 +51,7 @@ cmpl EXP_UNDER,EXP(%edi) jg xOp2_not_denorm - call _denormal_operand + call SYMBOL_NAME(denormal_operand) orl %eax,%eax jnz fpu_Arith_exit diff -ur linux-109/drivers/FPU-emu/reg_u_div.S linux/drivers/FPU-emu/reg_u_div.S --- linux-109/drivers/FPU-emu/reg_u_div.S Wed Dec 1 23:44:16 1993 +++ linux/drivers/FPU-emu/reg_u_div.S Sun Feb 15 12:46:22 1998 @@ -69,13 +69,8 @@ .text - .align 2,144 -.globl _reg_u_div - -.globl _divide_kernel - -_reg_u_div: +ENTRY(reg_u_div) pushl %ebp movl %esp,%ebp #ifdef REENTRANT_FPU @@ -95,7 +90,7 @@ cmpl EXP_UNDER,%eax jg xOp1_not_denorm - call _denormal_operand + call SYMBOL_NAME(denormal_operand) orl %eax,%eax jnz fpu_Arith_exit @@ -104,14 +99,14 @@ cmpl EXP_UNDER,%eax jg xOp2_not_denorm - call _denormal_operand + call SYMBOL_NAME(denormal_operand) orl %eax,%eax jnz fpu_Arith_exit xOp2_not_denorm: #endif DENORM_OPERAND -_divide_kernel: +ENTRY(divide_kernel) #ifdef PARANOID /* testl $0x80000000, SIGH(%esi) // Dividend */ /* je L_bugged */ diff -ur linux-109/drivers/FPU-emu/reg_u_mul.S linux/drivers/FPU-emu/reg_u_mul.S --- linux-109/drivers/FPU-emu/reg_u_mul.S Wed Dec 1 23:44:16 1993 +++ linux/drivers/FPU-emu/reg_u_mul.S Sun Feb 15 12:46:22 1998 @@ -44,10 +44,7 @@ .text - .align 2,144 - -.globl _reg_u_mul -_reg_u_mul: +ENTRY(reg_u_mul) pushl %ebp movl %esp,%ebp #ifdef REENTRANT_FPU @@ -73,7 +70,7 @@ cmpl EXP_UNDER,%eax jg xOp1_not_denorm - call _denormal_operand + call SYMBOL_NAME(denormal_operand) orl %eax,%eax jnz fpu_Arith_exit @@ -82,7 +79,7 @@ cmpl EXP_UNDER,%eax jg xOp2_not_denorm - call _denormal_operand + call SYMBOL_NAME(denormal_operand) orl %eax,%eax jnz fpu_Arith_exit diff -ur linux-109/drivers/FPU-emu/reg_u_sub.S linux/drivers/FPU-emu/reg_u_sub.S --- linux-109/drivers/FPU-emu/reg_u_sub.S Wed Dec 1 23:44:16 1993 +++ linux/drivers/FPU-emu/reg_u_sub.S Sun Feb 15 12:46:22 1998 @@ -30,9 +30,7 @@ #include "control_w.h" .text - .align 2,144 -.globl _reg_u_sub -_reg_u_sub: +ENTRY(reg_u_sub) pushl %ebp movl %esp,%ebp pushl %esi @@ -46,7 +44,7 @@ cmpl EXP_UNDER,EXP(%esi) jg xOp1_not_denorm - call _denormal_operand + call SYMBOL_NAME(denormal_operand) orl %eax,%eax jnz fpu_Arith_exit @@ -54,7 +52,7 @@ cmpl EXP_UNDER,EXP(%edi) jg xOp2_not_denorm - call _denormal_operand + call SYMBOL_NAME(denormal_operand) orl %eax,%eax jnz fpu_Arith_exit diff -ur linux-109/drivers/FPU-emu/wm_shrx.S linux/drivers/FPU-emu/wm_shrx.S --- linux-109/drivers/FPU-emu/wm_shrx.S Wed Dec 1 23:44:16 1993 +++ linux/drivers/FPU-emu/wm_shrx.S Sun Feb 15 12:46:23 1998 @@ -17,7 +17,6 @@ #include "fpu_asm.h" .text - .align 2,144 /*---------------------------------------------------------------------------+ | unsigned shrx(void *arg1, unsigned arg2) | @@ -33,9 +32,7 @@ | Results returned in the 64 bit arg and eax. | +---------------------------------------------------------------------------*/ - .globl _shrx - -_shrx: +ENTRY(shrx) push %ebp movl %esp,%ebp pushl %esi @@ -113,8 +110,7 @@ | part which has been shifted out of the arg. | | Results returned in the 64 bit arg and eax. | +---------------------------------------------------------------------------*/ - .globl _shrxs -_shrxs: +ENTRY(shrxs) push %ebp movl %esp,%ebp pushl %esi diff -ur linux-109/drivers/FPU-emu/wm_sqrt.S linux/drivers/FPU-emu/wm_sqrt.S --- linux-109/drivers/FPU-emu/wm_sqrt.S Wed Dec 1 23:44:16 1993 +++ linux/drivers/FPU-emu/wm_sqrt.S Sun Feb 15 12:46:23 1998 @@ -74,10 +74,7 @@ .text - .align 2,144 - -.globl _wm_sqrt -_wm_sqrt: +ENTRY(wm_sqrt) pushl %ebp movl %esp,%ebp #ifdef REENTRANT_FPU diff -ur linux-109/drivers/Makefile linux/drivers/Makefile --- linux-109/drivers/Makefile Wed Dec 1 23:44:16 1993 +++ linux/drivers/Makefile Mon Feb 16 19:06:53 1998 @@ -12,11 +12,15 @@ .c.s: $(CC) $(CFLAGS) -S $< .s.o: - $(AS) -c -o $*.o $< + $(AS) -o $*.o $< .c.o: $(CC) $(CFLAGS) -c $< -SUBDIRS = block char net +SUBDIRS = block char + +ifdef CONFIG_INET +SUBDIRS := $(SUBDIRS) net +endif ifdef CONFIG_MATH_EMULATION SUBDIRS := $(SUBDIRS) FPU-emu diff -ur linux-109/drivers/block/Makefile linux/drivers/block/Makefile --- linux-109/drivers/block/Makefile Mon Mar 7 00:08:21 1994 +++ linux/drivers/block/Makefile Mon Feb 16 18:49:58 1998 @@ -12,7 +12,7 @@ .c.s: $(CC) $(CFLAGS) -S $< .s.o: - $(AS) -c -o $*.o $< + $(AS) -o $*.o $< .c.o: $(CC) $(CFLAGS) -c $< @@ -21,8 +21,8 @@ # In the future, some of these should be built conditionally. # -OBJS := ll_rw_blk.o floppy.o ramdisk.o genhd.o -SRCS := ll_rw_blk.c floppy.c ramdisk.c genhd.c +OBJS := ll_rw_blk.o genhd.o +SRCS := ll_rw_blk.c genhd.c ifdef CONFIG_CDU31A OBJS := $(OBJS) cdu31a.o @@ -42,6 +42,16 @@ ifdef CONFIG_BLK_DEV_HD OBJS := $(OBJS) hd.o SRCS := $(SRCS) hd.c +endif + +ifdef CONFIG_BLK_DEV_FD +OBJS := $(OBJS) floppy.o +SRCS := $(SRCS) floppy.c +endif + +ifdef CONFIG_BLK_DEV_RAM +OBJS := $(OBJS) ramdisk.o +SRCS := $(SRCS) ramdisk.c endif ifdef CONFIG_BLK_DEV_XD diff -ur linux-109/drivers/block/genhd.c linux/drivers/block/genhd.c --- linux-109/drivers/block/genhd.c Wed Dec 1 23:44:15 1993 +++ linux/drivers/block/genhd.c Mon Feb 16 18:49:58 1998 @@ -19,8 +19,10 @@ static int current_minor = 0; extern int *blk_size[]; +#ifdef CONFIG_BLK_DEV_RAM extern void rd_load(void); extern int ramdisk_size; +#endif /* * Create devices for each logical partition in an extended partition. @@ -209,8 +211,10 @@ nr += p->nr_real; } +#ifdef CONFIG_BLK_DEV_RAM if (ramdisk_size) rd_load(); +#endif mount_root(); return (0); } diff -ur linux-109/drivers/block/ll_rw_blk.c linux/drivers/block/ll_rw_blk.c --- linux-109/drivers/block/ll_rw_blk.c Tue Feb 1 18:03:51 1994 +++ linux/drivers/block/ll_rw_blk.c Mon Feb 16 18:49:58 1998 @@ -497,7 +497,9 @@ #ifdef CONFIG_SBPCD mem_start = sbpcd_init(mem_start, mem_end); #endif CONFIG_SBPCD +#ifdef CONFIG_BLK_DEV_RAM if (ramdisk_size) mem_start += rd_init(mem_start, ramdisk_size*1024); +#endif return mem_start; } diff -ur linux-109/drivers/char/Makefile linux/drivers/char/Makefile --- linux-109/drivers/char/Makefile Mon Jan 10 00:14:58 1994 +++ linux/drivers/char/Makefile Mon Feb 16 18:49:58 1998 @@ -12,18 +12,23 @@ .c.s: $(CC) $(CFLAGS) -S $< .s.o: - $(AS) -c -o $*.o $< + $(AS) -o $*.o $< .c.o: $(CC) $(CFLAGS) -c $< -OBJS = tty_io.o console.o keyboard.o serial.o \ +OBJS = tty_io.o console.o keyboard.o \ tty_ioctl.o pty.o vt.o mem.o \ defkeymap.o -SRCS = tty_io.c console.c keyboard.c serial.c \ +SRCS = tty_io.c console.c keyboard.c \ tty_ioctl.c pty.c vt.c mem.c \ defkeymap.c + +ifdef CONFIG_SERIAL +OBJS := $(OBJS) serial.o +SRCS := $(SRCS) serial.c +endif ifdef CONFIG_ATIXL_BUSMOUSE M = y diff -ur linux-109/drivers/char/console.c linux/drivers/char/console.c --- linux-109/drivers/char/console.c Wed Feb 23 17:52:24 1994 +++ linux/drivers/char/console.c Tue Feb 17 18:12:47 1998 @@ -37,7 +37,11 @@ * */ -#define CAN_LOAD_EGA_FONTS /* undefine if the user must not do this */ +/* undefine if the user must not do this, or to save a bit of memory */ +#undef CAN_LOAD_EGA_FONTS + +/* define this if you want other (IBM and user defined) mappings */ +#undef CAN_DO_XTRA_TRANS /* * NOTE!!! We sometimes disable and enable interrupts for a short while @@ -76,6 +80,21 @@ static int sel_start = -1; static int sel_end; static char sel_buffer[SEL_BUFFER_SIZE] = { '\0' }; + +/* + * User settable table: what characters are to be considered alphabetic? + * 256 bits + */ +static unsigned long inwordLut[8]={ + 0x00000000, /* control chars */ + 0x03FF0000, /* digits */ + 0x87FFFFFE, /* uppercase and '_' */ + 0x07FFFFFE, /* lowercase */ + 0x00000000, + 0x00000000, + 0xFF7FFFFF, /* latin-1 accented letters, not multiplication sign */ + 0xFF7FFFFF /* latin-1 accented letters, not division sign */ +}; #endif /* CONFIG_SELECTION */ #define NPAR 16 @@ -250,7 +269,9 @@ "\376\376\376\376\216\217\222\200\376\220\376\376\376\376\376\376" "\376\245\376\376\376\376\231\376\376\376\376\376\232\376\376\341" "\205\240\203\376\204\206\221\207\212\202\210\211\215\241\214\213" - "\376\244\225\242\223\376\224\366\376\227\243\226\201\376\376\230", + "\376\244\225\242\223\376\224\366\376\227\243\226\201\376\376\230" +#ifdef CAN_DO_XTRA_TRANS +, /* <-- don't overlook this comma :) */ /* IBM graphics: minimal translations (BS, CR, LF, LL, SO, SI and ESC) */ (unsigned char *) "\000\001\002\003\004\005\006\007\000\011\000\013\000\000\000\000" @@ -287,12 +308,15 @@ "\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337" "\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357" "\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377" +#endif /* XTRA_TRANS */ }; #define NORM_TRANS (translations[0]) #define GRAF_TRANS (translations[1]) +#ifdef CAN_DO_XTRA_TRANS #define NULL_TRANS (translations[2]) #define USER_TRANS (translations[3]) +#endif static unsigned char color_table[] = { 0, 4, 2, 6, 1, 5, 3, 7, 8,12,10,14, 9,13,11,15 }; @@ -433,7 +457,7 @@ __asm__("cld\n\t" "rep\n\t" "movsl\n\t" - "movl _video_num_columns,%1\n\t" + "movl "SYMBOL_NAME_STR(video_num_columns)",%1\n\t" "rep\n\t" "stosw" : /* no output */ @@ -460,7 +484,7 @@ __asm__("cld\n\t" "rep\n\t" "movsl\n\t" - "movl _video_num_columns,%%ecx\n\t" + "movl "SYMBOL_NAME_STR(video_num_columns)",%%ecx\n\t" "rep\n\t" "stosw" : /* no output */ @@ -480,7 +504,7 @@ "rep\n\t" "movsl\n\t" "addl $2,%%edi\n\t" /* %edi has been decremented by 4 */ - "movl _video_num_columns,%%ecx\n\t" + "movl "SYMBOL_NAME_STR(video_num_columns)",%%ecx\n\t" "rep\n\t" "stosw\n\t" "cld" @@ -752,7 +776,7 @@ *p = (*p & 0x88) | (((*p >> 4) | (*p << 4)) & 0x77); else for (p = (unsigned char *)origin+1; p < (unsigned char *)scr_end; p+=2) - *p ^= *p & 0x07 == 1 ? 0x70 : 0x77; + *p ^= (*p & 0x07) == 1 ? 0x70 : 0x77; } static void set_mode(int currcons, int on_off) @@ -1283,10 +1307,12 @@ G0_charset = GRAF_TRANS; else if (c == 'B') G0_charset = NORM_TRANS; +#ifdef CAN_DO_XTRA_TRANS else if (c == 'U') G0_charset = NULL_TRANS; else if (c == 'K') G0_charset = USER_TRANS; +#endif if (charset == 0) translate = G0_charset; state = ESnormal; @@ -1296,10 +1322,12 @@ G1_charset = GRAF_TRANS; else if (c == 'B') G1_charset = NORM_TRANS; +#ifdef CAN_DO_XTRA_TRANS else if (c == 'U') G1_charset = NULL_TRANS; else if (c == 'K') G1_charset = USER_TRANS; +#endif if (charset == 1) translate = G1_charset; state = ESnormal; @@ -1626,6 +1654,20 @@ } #ifdef CONFIG_SELECTION + +static inline int inword(const unsigned char c) { + return ( inwordLut[c>>5] >> (c & 0x1F) ) & 1; +} + +/* set inwordLut contents. Invoked by ioctl(). */ +int sel_loadlut(const unsigned long arg) +{ + int i = verify_area(VERIFY_READ, (char *) arg, 36); + if (i) + return i; + memcpy_fromfs(inwordLut, (unsigned long *)(arg+4), 32); + return 0; +} /* correction factor for when screen is hardware-scrolled */ #define hwscroll_offset (currcons == fg_console ? ((__real_origin - __origin) << 1) : 0) @@ -1646,9 +1688,6 @@ *p = (*p & 0x88) | ((*p << 4) & 0x70) | ((*p >> 4) & 0x07); } -/* is c in range [a-zA-Z0-9_]? */ -static inline int inword(const char c) { return (isalnum(c) || c == '_'); } - /* does screen address p correspond to character at LH/RH edge of screen? */ static inline int atedge(const int p) { @@ -1940,6 +1979,7 @@ */ int con_set_trans(char * arg) { +#ifdef CAN_DO_XTRA_TRANS int i; i = verify_area(VERIFY_READ, (void *)arg, E_TABSZ); @@ -1952,10 +1992,14 @@ USER_TRANS[015]=0; USER_TRANS[033]=0; return 0; +#else + return -ENOSYS; +#endif } int con_get_trans(char * arg) { +#ifdef CAN_DO_XTRA_TRANS int i; i = verify_area(VERIFY_WRITE, (void *)arg, E_TABSZ); @@ -1964,4 +2008,7 @@ for (i=0; istate = TASK_INTERRUPTIBLE; current->timeout = jiffies + 5; diff -ur linux-109/drivers/char/serial.c linux/drivers/char/serial.c --- linux-109/drivers/char/serial.c Mon Mar 14 06:20:21 1994 +++ linux/drivers/char/serial.c Mon Feb 16 18:49:58 1998 @@ -147,54 +147,6 @@ { BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS }, /* ttyS1 */ { BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS }, /* ttyS2 */ { BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS }, /* ttyS3 */ - - { BASE_BAUD, 0x1A0, 9, FOURPORT_FLAGS }, /* ttyS4 */ - { BASE_BAUD, 0x1A8, 9, FOURPORT_FLAGS }, /* ttyS5 */ - { BASE_BAUD, 0x1B0, 9, FOURPORT_FLAGS }, /* ttyS6 */ - { BASE_BAUD, 0x1B8, 9, FOURPORT_FLAGS }, /* ttyS7 */ - - { BASE_BAUD, 0x2A0, 5, FOURPORT_FLAGS }, /* ttyS8 */ - { BASE_BAUD, 0x2A8, 5, FOURPORT_FLAGS }, /* ttyS9 */ - { BASE_BAUD, 0x2B0, 5, FOURPORT_FLAGS }, /* ttyS10 */ - { BASE_BAUD, 0x2B8, 5, FOURPORT_FLAGS }, /* ttyS11 */ - - { BASE_BAUD, 0x330, 4, ACCENT_FLAGS }, /* ttyS12 */ - { BASE_BAUD, 0x338, 4, ACCENT_FLAGS }, /* ttyS13 */ - { BASE_BAUD, 0x000, 0, 0 }, /* ttyS14 (spare; user configurable) */ - { BASE_BAUD, 0x000, 0, 0 }, /* ttyS15 (spare; user configurable) */ - - { BASE_BAUD, 0x100, 12, BOCA_FLAGS }, /* ttyS16 */ - { BASE_BAUD, 0x108, 12, BOCA_FLAGS }, /* ttyS17 */ - { BASE_BAUD, 0x110, 12, BOCA_FLAGS }, /* ttyS18 */ - { BASE_BAUD, 0x118, 12, BOCA_FLAGS }, /* ttyS19 */ - { BASE_BAUD, 0x120, 12, BOCA_FLAGS }, /* ttyS20 */ - { BASE_BAUD, 0x128, 12, BOCA_FLAGS }, /* ttyS21 */ - { BASE_BAUD, 0x130, 12, BOCA_FLAGS }, /* ttyS22 */ - { BASE_BAUD, 0x138, 12, BOCA_FLAGS }, /* ttyS23 */ - { BASE_BAUD, 0x140, 12, BOCA_FLAGS }, /* ttyS24 */ - { BASE_BAUD, 0x148, 12, BOCA_FLAGS }, /* ttyS25 */ - { BASE_BAUD, 0x150, 12, BOCA_FLAGS }, /* ttyS26 */ - { BASE_BAUD, 0x158, 12, BOCA_FLAGS }, /* ttyS27 */ - { BASE_BAUD, 0x160, 12, BOCA_FLAGS }, /* ttyS28 */ - { BASE_BAUD, 0x168, 12, BOCA_FLAGS }, /* ttyS29 */ - { BASE_BAUD, 0x170, 12, BOCA_FLAGS }, /* ttyS30 */ - { BASE_BAUD, 0x178, 12, BOCA_FLAGS }, /* ttyS31 */ - -/* You can have up to four HUB6's in the system, but I've only - * included two cards here for a total of twelve ports. - */ - { BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,0) }, /* ttyS32 */ - { BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,1) }, /* ttyS33 */ - { BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,2) }, /* ttyS34 */ - { BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,3) }, /* ttyS35 */ - { BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,4) }, /* ttyS36 */ - { BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,5) }, /* ttyS37 */ - { BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,0) }, /* ttyS32 */ - { BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,1) }, /* ttyS33 */ - { BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,2) }, /* ttyS34 */ - { BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,3) }, /* ttyS35 */ - { BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,4) }, /* ttyS36 */ - { BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,5) }, /* ttyS37 */ }; #define NR_PORTS (sizeof(rs_table)/sizeof(struct async_struct)) diff -ur linux-109/drivers/char/tty_io.c linux/drivers/char/tty_io.c --- linux-109/drivers/char/tty_io.c Wed Mar 2 04:00:15 1994 +++ linux/drivers/char/tty_io.c Mon Feb 16 18:49:58 1998 @@ -37,6 +37,7 @@ * -- julian@uhunix.uhcc.hawaii.edu (J. Cowley), 13Jan94 */ +#include #include #include #include @@ -1778,8 +1779,10 @@ tty->open = con_open; tty->winsize.ws_row = video_num_lines; tty->winsize.ws_col = video_num_columns; +#ifdef CONFIG_SERIAL } else if IS_A_SERIAL(line) { tty->open = rs_open; +#endif } else if IS_A_PTY(line) { tty->open = pty_open; } @@ -1840,6 +1843,8 @@ kmem_start = kbd_init(kmem_start); kmem_start = con_init(kmem_start); +#ifdef CONFIG_SERIAL kmem_start = rs_init(kmem_start); +#endif return kmem_start; } diff -ur linux-109/drivers/char/tty_ioctl.c linux/drivers/char/tty_ioctl.c --- linux-109/drivers/char/tty_ioctl.c Sun Feb 15 12:31:53 1998 +++ linux/drivers/char/tty_ioctl.c Sun Feb 15 18:42:45 1998 @@ -38,6 +38,8 @@ #ifdef CONFIG_SELECTION extern int set_selection(const int arg); extern int paste_selection(struct tty_struct *tty); +extern int sel_loadlut(const unsigned long arg); +extern int shift_state; #endif /* CONFIG_SELECTION */ static int tty_set_ldisc(struct tty_struct *tty, int ldisc); @@ -564,6 +566,11 @@ return paste_selection(tty); case 4: unblank_screen(); + return 0; + case 5: + return sel_loadlut(arg); + case 6: + put_fs_byte(shift_state, arg); return 0; #endif /* CONFIG_SELECTION */ default: diff -ur linux-109/drivers/char/vt.c linux/drivers/char/vt.c --- linux-109/drivers/char/vt.c Fri Feb 11 22:06:42 1994 +++ linux/drivers/char/vt.c Tue Feb 17 21:36:56 1998 @@ -37,6 +37,9 @@ struct vt_struct vt_cons[NR_CONSOLES]; +/* define this if you need/use some of the rare unused ioctls. */ +#undef KBD_RARE_IOTCL + asmlinkage int sys_ioperm(unsigned long from, unsigned long num, int on); extern void compute_shiftstate(void); @@ -154,6 +157,7 @@ put_fs_byte(KB_101, (char *) arg); return i; +#ifdef KBD_RARE_IOTCL case KDADDIO: case KDDELIO: /* @@ -168,7 +172,14 @@ case KDDISABIO: return sys_ioperm(GPFIRST, GPNUM, (cmd == KDENABIO)) ? -ENXIO : 0; - + case KDMAPDISP: + case KDUNMAPDISP: + /* + * these work like a combination of mmap and KDENABIO. + * this could be easily finished. + */ + return -EINVAL; +#endif /* KBD_RARE_IOTCL */ case KDSETMODE: /* * currently, setting the mode from KD_TEXT to KD_GRAPHICS @@ -207,15 +218,6 @@ if (!i) put_fs_long(vt_cons[console].vc_mode, (unsigned long *) arg); return i; - - case KDMAPDISP: - case KDUNMAPDISP: - /* - * these work like a combination of mmap and KDENABIO. - * this could be easily finished. - */ - return -EINVAL; - case KDSKBMODE: switch(arg) { case K_RAW: @@ -249,6 +251,7 @@ /* this could be folded into KDSKBMODE, but for compatibility reasons it is not so easy to fold KDGKBMETA into KDGKBMODE */ +#ifdef KBD_RARE_IOTCL case KDSKBMETA: switch(arg) { case K_METABIT: @@ -407,7 +410,7 @@ memcpy_fromfs(accent_table, a->kbdiacr, ct*sizeof(struct kbdiacr)); return 0; } - +#endif /* KBD_RARE_IOTCL */ case KDGETLED: i = verify_area(VERIFY_WRITE, (void *) arg, sizeof(unsigned char)); if (i) diff -ur linux-109/drivers/net/3c503.c linux/drivers/net/3c503.c --- linux-109/drivers/net/3c503.c Mon Mar 7 00:12:04 1994 +++ linux/drivers/net/3c503.c Sun Feb 15 12:46:24 1998 @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include diff -ur linux-109/drivers/net/Makefile linux/drivers/net/Makefile --- linux-109/drivers/net/Makefile Tue Feb 22 17:38:04 1994 +++ linux/drivers/net/Makefile Mon Feb 16 19:06:53 1998 @@ -7,7 +7,7 @@ # are difficult for users to deal with. include CONFIG -NETDRV_OBJS := net.a(Space.o) net.a(auto_irq.o) net.a(net_init.o) +NETDRV_OBJS := net.a(Space.o) net.a(net_init.o) CFLAGS := $(CFLAGS) -I../../net/inet CPP := $(CPP) -I../../net/inet @@ -18,6 +18,10 @@ $(CC) $(CFLAGS) $(OPTS) $(DL_OPTS) -c $< -o $@ net_init.o: ../../include/linux/autoconf.h + +ifdef CONFIG_ETHERCARDS +NETDRV_OBJS := $(NETDRV_OBJS) net.a(auto_irq.o) +endif ifdef CONFIG_WD80x3 NETDRV_OBJS := $(NETDRV_OBJS) net.a(wd.o) diff -ur linux-109/drivers/net/ne.c linux/drivers/net/ne.c --- linux-109/drivers/net/ne.c Mon Mar 7 00:12:04 1994 +++ linux/drivers/net/ne.c Mon Feb 16 18:49:59 1998 @@ -175,29 +175,15 @@ } #endif - neX000 = (SA_prom[14] == 0x57 && SA_prom[15] == 0x57); - ctron = (SA_prom[0] == 0x00 && SA_prom[1] == 0x00 && SA_prom[2] == 0x1d); - dlink = (SA_prom[0] == 0x00 && SA_prom[1] == 0xDE && SA_prom[2] == 0x01); - dfi = (SA_prom[0] == 'D' && SA_prom[1] == 'F' && SA_prom[2] == 'I'); - /* Set up the rest of the parameters. */ - if (neX000 || dlink || dfi) { - if (wordlength == 2) { - name = dlink ? "DE200" : "NE2000"; - start_page = NESM_START_PG; - stop_page = NESM_STOP_PG; - } else { - name = dlink ? "DE100" : "NE1000"; - start_page = NE1SM_START_PG; - stop_page = NE1SM_STOP_PG; - } - } else if (ctron) { - name = "Cabletron"; - start_page = 0x01; - stop_page = (wordlength == 2) ? 0x40 : 0x20; + if (wordlength == 2) { + name = "NE2000"; + start_page = NESM_START_PG; + stop_page = NESM_STOP_PG; } else { - printk(" not found.\n"); - return 0; + name = "NE1000"; + start_page = NE1SM_START_PG; + stop_page = NE1SM_STOP_PG; } if (dev->irq < 2) { diff -ur linux-109/drivers/net/net_init.c linux/drivers/net/net_init.c --- linux-109/drivers/net/net_init.c Wed Dec 1 23:44:15 1993 +++ linux/drivers/net/net_init.c Sun Feb 15 12:46:24 1998 @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include diff -ur linux-109/drivers/net/wd.c linux/drivers/net/wd.c --- linux-109/drivers/net/wd.c Fri Dec 17 20:38:47 1993 +++ linux/drivers/net/wd.c Mon Feb 16 18:49:59 1998 @@ -106,24 +106,7 @@ for (i = 0; i < 6; i++) printk(" %2.2X", station_addr[i] = inb(ioaddr + 8 + i)); - /* The following PureData probe code was contributed by - Mike Jagdis . Puredata does software - configuration differently from others so we have to check for them. - This detects an 8 bit, 16 bit or dumb (Toshiba, jumpered) card. - */ - if (inb(ioaddr+0) == 'P' && inb(ioaddr+1) == 'D') { - unsigned char reg5 = inb(ioaddr+5); - - switch (inb(ioaddr+2)) { - case 0x03: word16 = 0; model_name = "PDI8023-8"; break; - case 0x05: word16 = 0; model_name = "PDUC8023"; break; - case 0x0a: word16 = 1; model_name = "PDI8023-16"; break; - /* Either 0x01 (dumb) or they've released a new version. */ - default: word16 = 0; model_name = "PDI8023"; break; - } - dev->mem_start = ((reg5 & 0x1c) + 0xc0) << 12; - dev->irq = (reg5 & 0xe0) == 0xe0 ? 10 : (reg5 >> 5) + 1; - } else { /* End of PureData probe */ + { /* This method of checking for a 16-bit board is borrowed from the we.c driver. A simpler method is just to look in ASIC reg. 0x03. I'm comparing the two method in alpha test to make certain they @@ -229,13 +212,19 @@ ei_status.word16 = word16; ei_status.tx_start_page = WD_START_PG; ei_status.rx_start_page = WD_START_PG + TX_PAGES; - ei_status.stop_page = word16 ? WD13_STOP_PG : WD03_STOP_PG; - - /* Don't map in the shared memory until the board is actually opened. */ - dev->rmem_start = dev->mem_start + TX_PAGES*256; - dev->mem_end = dev->rmem_end - = dev->mem_start + (ei_status.stop_page - WD_START_PG)*256; + /* Don't map in the shared memory until the board is actually opened. */ + dev->rmem_start = dev->mem_start + TX_PAGES*256; + + /* Some cards (eg WD8003EBT) can be jumpered for more (32k!) memory. */ + if (dev->mem_end != 0) { + ei_status.stop_page = (dev->mem_end - dev->mem_start)/256; + } else { + ei_status.stop_page = word16 ? WD13_STOP_PG : WD03_STOP_PG; + dev->mem_end = dev->mem_start + (ei_status.stop_page - WD_START_PG)*256; + } + dev->rmem_end = dev->mem_end; + printk(" %s, IRQ %d, shared memory at %#lx-%#lx.\n", model_name, dev->irq, dev->mem_start, dev->mem_end-1); if (ei_debug > 0) diff -ur linux-109/drivers/scsi/seagate.c linux/drivers/scsi/seagate.c --- linux-109/drivers/scsi/seagate.c Wed Dec 1 23:44:16 1993 +++ linux/drivers/scsi/seagate.c Sun Feb 15 12:46:24 1998 @@ -1103,8 +1103,8 @@ cld - movl _st0x_cr_sr, %%ebx - movl _st0x_dr, %%edi + movl "SYMBOL_NAME_STR(st0x_cr_sr)", %%ebx + movl "SYMBOL_NAME_STR(st0x_dr)", %%edi 1: movb (%%ebx), %%al\n" /* @@ -1239,8 +1239,8 @@ jz 2f cld - movl _st0x_cr_sr, %%esi - movl _st0x_dr, %%ebx + movl "SYMBOL_NAME_STR(st0x_cr_sr)", %%esi + movl "SYMBOL_NAME_STR(st0x_dr)", %%ebx 1: movb (%%esi), %%al\n" /* diff -ur linux-109/drivers/scsi/ultrastor.c linux/drivers/scsi/ultrastor.c --- linux-109/drivers/scsi/ultrastor.c Mon Jan 24 18:55:21 1994 +++ linux/drivers/scsi/ultrastor.c Sun Feb 15 12:46:24 1998 @@ -282,23 +282,29 @@ static inline int find_and_clear_bit_16(unsigned short *field) { int rv; + unsigned long flags; + + save_flags(flags); cli(); if (*field == 0) panic("No free mscp"); asm("xorl %0,%0\n0:\tbsfw %1,%w0\n\tbtr %0,%1\n\tjnc 0b" : "=&r" (rv), "=m" (*field) : "1" (*field)); - sti(); + restore_flags(flags); return rv; } -/* This asm is fragile: it doesn't work without the casts and it may +/* This has been re-implemented with the help of Richard Earnshaw, + and works with gcc-2.5.8 and gcc-2.6.0. + The instability noted by jfc below appears to be a bug in + gcc-2.5.x when compiling w/o optimization. --Caleb + + This asm is fragile: it doesn't work without the casts and it may not work without optimization. Maybe I should add a swap builtin to gcc. --jfc */ static inline unsigned char xchgb(unsigned char reg, volatile unsigned char *mem) { - asm("xchgb %0,%1" : - "=r" (reg), "=m" (*(unsigned char *)mem) : - "0" (reg), "1" (*(unsigned char *)mem)); + __asm__ ("xchgb %0,%1" : "=q" (reg), "=m" (*mem) : "0" (reg)); return reg; } diff -ur linux-109/drivers/sound/Makefile linux/drivers/sound/Makefile --- linux-109/drivers/sound/Makefile Sat Jan 22 00:59:46 1994 +++ linux/drivers/sound/Makefile Sun Feb 15 12:46:24 1998 @@ -11,7 +11,7 @@ .c.s: $(CC) $(CFLAGS) -S $< .s.o: - $(AS) -c -o $*.o $< + $(AS) -o $*.o $< .c.o: $(CC) $(CFLAGS) -c $< diff -ur linux-109/fs/binfmt_elf.c linux/fs/binfmt_elf.c --- linux-109/fs/binfmt_elf.c Thu Feb 17 18:07:27 1994 +++ linux/fs/binfmt_elf.c Sun Feb 15 19:09:21 1998 @@ -618,7 +618,7 @@ if(k > elf_bss) elf_bss = k; sys_close(fd); - if (error != elf_phdata->p_vaddr & 0xfffff000) { + if (error != (elf_phdata->p_vaddr & 0xfffff000)) { kfree(elf_phdata); return error; } diff -ur linux-109/fs/buffer.c linux/fs/buffer.c --- linux-109/fs/buffer.c Thu Mar 10 22:20:55 1994 +++ linux/fs/buffer.c Mon Feb 16 18:49:59 1998 @@ -220,15 +220,19 @@ void check_disk_change(dev_t dev) { int i; - struct buffer_head * bh; switch(MAJOR(dev)){ +#ifdef CONFIG_BLK_DEV_FD case FLOPPY_MAJOR: + { + struct buffer_head * bh; if (!(bh = getblk(dev,0,1024))) return; i = floppy_change(bh); brelse(bh); break; + } +#endif #if defined(CONFIG_BLK_DEV_SD) && defined(CONFIG_SCSI) case SCSI_DISK_MAJOR: diff -ur linux-109/fs/exec.c linux/fs/exec.c --- linux-109/fs/exec.c Fri Mar 4 23:10:38 1994 +++ linux/fs/exec.c Tue Feb 17 00:44:03 1998 @@ -46,6 +46,9 @@ #include #include +/* define this if you actually want/use core dumps */ +#undef CORE_DUMPS + asmlinkage int sys_exit(int exit_code); asmlinkage int sys_close(unsigned fd); asmlinkage int sys_open(const char *, int, int); @@ -115,6 +118,7 @@ */ int core_dump(long signr, struct pt_regs * regs) { +#ifdef CORE_DUMPS struct inode * inode = NULL; struct file file; unsigned short fs; @@ -227,6 +231,9 @@ set_fs(fs); iput(inode); return has_dumped; +#else + return 0; +#endif /* CORE_DUMPS */ } /* @@ -726,9 +733,11 @@ * well as the dispatch table itself. */ +#ifdef CONFIG_BINFMT_AOUT extern int load_aout_binary(struct linux_binprm *, struct pt_regs * regs); extern int load_aout_library(int fd); +#endif #ifdef CONFIG_BINFMT_ELF extern int load_elf_binary(struct linux_binprm *, @@ -744,7 +753,9 @@ /* Here are the actual binaries that will be accepted */ struct linux_binfmt formats[] = { +#ifdef CONFIG_BINFMT_AOUT {load_aout_binary, load_aout_library}, +#endif #ifdef CONFIG_BINFMT_ELF {load_elf_binary, load_elf_library}, #endif @@ -759,6 +770,7 @@ * libraries. There is no binary dependent code anywhere else. */ +#ifdef CONFIG_BINFMT_AOUT int load_aout_binary(struct linux_binprm * bprm, struct pt_regs * regs) { struct exec ex; @@ -908,3 +920,4 @@ MAP_PRIVATE|MAP_FIXED, 0); return 0; } +#endif /* AOUT */ diff -ur linux-109/fs/isofs/namei.c linux/fs/isofs/namei.c --- linux-109/fs/isofs/namei.c Sun Dec 12 21:26:43 1993 +++ linux/fs/isofs/namei.c Sun Feb 15 12:46:24 1998 @@ -26,32 +26,28 @@ */ static int isofs_match(int len,const char * name, char * compare, int dlen) { - register int same __asm__("ax"); - - if (!compare) return 0; - /* "" means "." ---> so paths like "/usr/lib//libc.a" work */ - if (!len && (compare[0]==0) && (dlen==1)) - return 1; - - if (compare[0]==0 && dlen==1 && len == 1) - compare = "."; - if (compare[0]==1 && dlen==1 && len == 2) { - compare = ".."; - dlen = 2; - }; + if (!compare) + return 0; + + /* check special "." and ".." files */ + if (dlen == 1) { + /* "." */ + if (compare[0] == 0) { + if (!len) + return 1; + compare = "."; + } else if (compare[0] == 1) { + compare = ".."; + dlen = 2; + } + } #if 0 if (len <= 2) printk("Match: %d %d %s %d %d \n",len,dlen,compare,de->name[0], dlen); #endif if (dlen != len) return 0; - __asm__("cld\n\t" - "repe ; cmpsb\n\t" - "setz %%al" - :"=a" (same) - :"0" (0),"S" ((long) name),"D" ((long) compare),"c" (len) - :"cx","di","si"); - return same; + return !memcmp(name, compare, len); } /* diff -ur linux-109/fs/proc/array.c linux/fs/proc/array.c --- linux-109/fs/proc/array.c Sun Feb 15 12:31:56 1998 +++ linux/fs/proc/array.c Mon Feb 16 18:49:59 1998 @@ -464,7 +464,9 @@ return sz; } +#ifdef CONFIG_MODULES extern int get_module_list(char *); +#endif static int array_read(struct inode * inode, struct file * file,char * buf, int count) { @@ -516,9 +518,11 @@ case 15: length = get_maps(pid, page); break; +#ifdef CONFIG_MODULES case 16: length = get_module_list(page); break; +#endif case 17: length = get_kstat(page); break; diff -ur linux-109/fs/proc/root.c linux/fs/proc/root.c --- linux-109/fs/proc/root.c Tue Feb 1 18:03:51 1994 +++ linux/fs/proc/root.c Mon Feb 16 18:49:59 1998 @@ -65,7 +65,9 @@ {13,6,"malloc" }, #endif {14,5,"kcore" }, +#ifdef CONFIG_MODULES {16,7,"modules" }, +#endif {17,4,"stat" }, }; diff -ur linux-109/fs/super.c linux/fs/super.c --- linux-109/fs/super.c Tue Mar 1 17:27:32 1994 +++ linux/fs/super.c Tue Feb 17 00:44:03 1998 @@ -143,8 +143,10 @@ return NULL; } for (s = 0+super_blocks ;; s++) { - if (s >= NR_SUPER+super_blocks) + if (s >= NR_SUPER+super_blocks) { + printk("VFS: Out of superblocks. Increase NR_SUPER in \n"); return NULL; + } if (!s->s_dev) break; } diff -ur linux-109/ibcs/Makefile linux/ibcs/Makefile --- linux-109/ibcs/Makefile Wed Dec 1 23:44:15 1993 +++ linux/ibcs/Makefile Wed Mar 18 16:23:55 1998 @@ -7,12 +7,14 @@ # # Note 2! The CFLAGS definitions are now in the main makefile... +.S.o: + $(CC) $(CFLAGS) -c -traditional $< -o $*.s .S.s: $(CPP) -traditional $< -o $*.s .c.s: $(CC) $(CFLAGS) -S $< .s.o: - $(AS) -c -o $*.o $< + $(AS) -o $*.o $< .c.o: $(CC) $(CFLAGS) -c $< @@ -26,7 +28,6 @@ dep: $(CPP) -M *.c > .depend - set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i dep; done dummy: diff -ur linux-109/include/asm/io.h linux/include/asm/io.h --- linux-109/include/asm/io.h Fri Feb 4 18:59:16 1994 +++ linux/include/asm/io.h Sun Feb 15 12:15:26 1998 @@ -49,9 +49,9 @@ #define __OUT(s,s1,x) \ __OUT1(s,x) __OUT2(s,s1,"w") : : "a" (value), "d" (port)); } \ -__OUT1(s##c,x) __OUT2(s,s1,"") : : "a" (value), "i" (port)); } \ +__OUT1(s##c,x) __OUT2(s,s1,"") : : "a" (value), "id" (port)); } \ __OUT1(s##_p,x) __OUT2(s,s1,"w") : : "a" (value), "d" (port)); SLOW_DOWN_IO; } \ -__OUT1(s##c_p,x) __OUT2(s,s1,"") : : "a" (value), "i" (port)); SLOW_DOWN_IO; } +__OUT1(s##c_p,x) __OUT2(s,s1,"") : : "a" (value), "id" (port)); SLOW_DOWN_IO; } #define __IN1(s) \ extern inline unsigned int __in##s(unsigned short port) { unsigned int _v; @@ -61,9 +61,9 @@ #define __IN(s,s1,i...) \ __IN1(s) __IN2(s,s1,"w") : "=a" (_v) : "d" (port) ,##i ); return _v; } \ -__IN1(s##c) __IN2(s,s1,"") : "=a" (_v) : "i" (port) ,##i ); return _v; } \ +__IN1(s##c) __IN2(s,s1,"") : "=a" (_v) : "id" (port) ,##i ); return _v; } \ __IN1(s##_p) __IN2(s,s1,"w") : "=a" (_v) : "d" (port) ,##i ); SLOW_DOWN_IO; return _v; } \ -__IN1(s##c_p) __IN2(s,s1,"") : "=a" (_v) : "i" (port) ,##i ); SLOW_DOWN_IO; return _v; } +__IN1(s##c_p) __IN2(s,s1,"") : "=a" (_v) : "id" (port) ,##i ); SLOW_DOWN_IO; return _v; } #define __INS(s) \ extern inline void ins##s(unsigned short port, void * addr, unsigned long count) \ diff -ur linux-109/include/asm/irq.h linux/include/asm/irq.h --- linux-109/include/asm/irq.h Fri Dec 31 19:10:42 1993 +++ linux/include/asm/irq.h Sun Feb 15 12:46:25 1998 @@ -7,8 +7,8 @@ * (C) 1992, 1993 Linus Torvalds */ -#include #include +#include extern void disable_irq(unsigned int); extern void enable_irq(unsigned int); @@ -79,8 +79,8 @@ "inb $0x21,%al\n\t" \ "jmp 1f\n" \ "1:\tjmp 1f\n" \ - "1:\torb $" #mask ",_cache_21\n\t" \ - "movb _cache_21,%al\n\t" \ + "1:\torb $" #mask ","SYMBOL_NAME_STR(cache_21)"\n\t" \ + "movb "SYMBOL_NAME_STR(cache_21)",%al\n\t" \ "outb %al,$0x21\n\t" \ "jmp 1f\n" \ "1:\tjmp 1f\n" \ @@ -91,8 +91,8 @@ "inb $0xA1,%al\n\t" \ "jmp 1f\n" \ "1:\tjmp 1f\n" \ - "1:\torb $" #mask ",_cache_A1\n\t" \ - "movb _cache_A1,%al\n\t" \ + "1:\torb $" #mask ","SYMBOL_NAME_STR(cache_A1)"\n\t" \ + "movb "SYMBOL_NAME_STR(cache_A1)",%al\n\t" \ "outb %al,$0xA1\n\t" \ "jmp 1f\n" \ "1:\tjmp 1f\n" \ @@ -106,16 +106,16 @@ "inb $0x21,%al\n\t" \ "jmp 1f\n" \ "1:\tjmp 1f\n" \ - "1:\tandb $~(" #mask "),_cache_21\n\t" \ - "movb _cache_21,%al\n\t" \ + "1:\tandb $~(" #mask "),"SYMBOL_NAME_STR(cache_21)"\n\t" \ + "movb "SYMBOL_NAME_STR(cache_21)",%al\n\t" \ "outb %al,$0x21\n\t" #define UNBLK_SECOND(mask) \ "inb $0xA1,%al\n\t" \ "jmp 1f\n" \ "1:\tjmp 1f\n" \ - "1:\tandb $~(" #mask "),_cache_A1\n\t" \ - "movb _cache_A1,%al\n\t" \ + "1:\tandb $~(" #mask "),"SYMBOL_NAME_STR(cache_A1)"\n\t" \ + "movb "SYMBOL_NAME_STR(cache_A1)",%al\n\t" \ "outb %al,$0xA1\n\t" #define IRQ_NAME2(nr) nr##_interrupt(void) @@ -128,36 +128,36 @@ asmlinkage void FAST_IRQ_NAME(nr); \ asmlinkage void BAD_IRQ_NAME(nr); \ __asm__( \ -"\n.align 4\n" \ -"_IRQ" #nr "_interrupt:\n\t" \ +"\n"ALIGN_STR"\n" \ +SYMBOL_NAME_STR(IRQ) #nr "_interrupt:\n\t" \ "pushl $-"#nr"-2\n\t" \ SAVE_ALL \ ACK_##chip(mask) \ - "incl _intr_count\n\t"\ + "incl "SYMBOL_NAME_STR(intr_count)"\n\t"\ "sti\n\t" \ "movl %esp,%ebx\n\t" \ "pushl %ebx\n\t" \ "pushl $" #nr "\n\t" \ - "call _do_IRQ\n\t" \ + "call "SYMBOL_NAME_STR(do_IRQ)"\n\t" \ "addl $8,%esp\n\t" \ "cli\n\t" \ UNBLK_##chip(mask) \ - "decl _intr_count\n\t" \ + "decl "SYMBOL_NAME_STR(intr_count)"\n\t" \ "jmp ret_from_sys_call\n" \ -"\n.align 4\n" \ -"_fast_IRQ" #nr "_interrupt:\n\t" \ +"\n"ALIGN_STR"\n" \ +SYMBOL_NAME_STR(fast_IRQ) #nr "_interrupt:\n\t" \ SAVE_MOST \ ACK_##chip(mask) \ - "incl _intr_count\n\t" \ + "incl "SYMBOL_NAME_STR(intr_count)"\n\t" \ "pushl $" #nr "\n\t" \ - "call _do_fast_IRQ\n\t" \ + "call "SYMBOL_NAME_STR(do_fast_IRQ)"\n\t" \ "addl $4,%esp\n\t" \ "cli\n\t" \ UNBLK_##chip(mask) \ - "decl _intr_count\n\t" \ + "decl "SYMBOL_NAME_STR(intr_count)"\n\t" \ RESTORE_MOST \ -"\n\n.align 4\n" \ -"_bad_IRQ" #nr "_interrupt:\n\t" \ +"\n"ALIGN_STR"\n" \ +SYMBOL_NAME_STR(bad_IRQ) #nr "_interrupt:\n\t" \ SAVE_MOST \ ACK_##chip(mask) \ RESTORE_MOST); diff -ur linux-109/include/linux/fs.h linux/include/linux/fs.h --- linux-109/include/linux/fs.h Sun Feb 15 12:31:54 1998 +++ linux/include/linux/fs.h Tue Feb 17 00:54:17 1998 @@ -27,7 +27,7 @@ #define NR_INODE 2048 /* this should be bigger than NR_FILE */ #define NR_FILE 1024 /* this can well be larger on a larger system */ -#define NR_SUPER 32 +#define NR_SUPER 8 #define NR_HASH 997 #define NR_IHASH 131 #define NR_FILE_LOCKS 64 diff -ur linux-109/include/linux/if.h linux/include/linux/if.h --- linux-109/include/linux/if.h Wed Dec 1 23:44:15 1993 +++ linux/include/linux/if.h Sun Feb 15 21:59:35 1998 @@ -42,12 +42,14 @@ #endif } if_snd; /* output queue */ +#ifdef not_yet_in_linux /* Procedure handles. */ int (*if_init)(); /* init routine */ int (*if_output)(); /* output routine */ int (*if_ioctl)(); /* ioctl routine */ int (*if_reset)(); /* bus reset routine */ int (*if_watchdog)(); /* timer routine */ +#endif /* Generic interface statistics. */ int if_ipackets; /* packets recv'd on interface */ diff -ur linux-109/include/linux/kernel.h linux/include/linux/kernel.h --- linux-109/include/linux/kernel.h Sun Feb 15 12:31:49 1998 +++ linux/include/linux/kernel.h Mon Feb 16 18:49:59 1998 @@ -25,19 +25,21 @@ #define KERN_INFO "<6>" /* informational */ #define KERN_DEBUG "<7>" /* debug-level messages */ -#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) -# define NORET_TYPE __volatile__ -# define ATTRIB_NORET /**/ -# define NORET_AND /**/ -#else # define NORET_TYPE /**/ # define ATTRIB_NORET __attribute__((noreturn)) # define NORET_AND noreturn, -#endif extern void math_error(void); -NORET_TYPE void panic(const char * fmt, ...) - __attribute__ ((NORET_AND format (printf, 1, 2))); + +NORET_TYPE void panic_at(const void *location) + ATTRIB_NORET; + +#define panic(fmt,arg...) \ +({ __label__ whoops; \ +whoops: \ + panic_at(&&whoops); \ +}) + NORET_TYPE void do_exit(long error_code) ATTRIB_NORET; unsigned long simple_strtoul(const char *,char **,unsigned int); diff -ur linux-109/include/linux/linkage.h linux/include/linux/linkage.h --- linux-109/include/linux/linkage.h Wed Dec 1 23:44:15 1993 +++ linux/include/linux/linkage.h Mon Feb 16 13:42:00 1998 @@ -1,10 +1,43 @@ #ifndef _LINUX_LINKAGE_H #define _LINUX_LINKAGE_H -#ifdef __cplusplus -#define asmlinkage extern "C" -#else #define asmlinkage + +/* + * The a.out "as" interprets .align as 2^n, but ELF "as" interprets as n. + * For absolute minimum size, (at a performance cost) don't do alignment. + * Only really impacts sys_call.S anyway. + */ +#ifdef __ELF__ +#define ALIGN .align 4,0x90 +#define ALIGN_STR ".align 4,0x90" +#else +#define ALIGN .align 2,0x90 +#define ALIGN_STR ".align 2,0x90" +#endif + +#ifdef __ELF__ +#define SYMBOL_NAME_STR(X) #X +#define SYMBOL_NAME(X) X +#ifdef __STDC__ +#define SYMBOL_NAME_LABEL(X) X##: +#else +#define SYMBOL_NAME_LABEL(X) X/**/: +#endif +#else +#define SYMBOL_NAME_STR(X) "_"#X +#ifdef __STDC__ +#define SYMBOL_NAME(X) _##X +#define SYMBOL_NAME_LABEL(X) _##X##: +#else +#define SYMBOL_NAME(X) _/**/X +#define SYMBOL_NAME_LABEL(X) _/**/X/**/: +#endif #endif + +#define ENTRY(name) \ + .globl SYMBOL_NAME(name); \ + ALIGN; \ + SYMBOL_NAME_LABEL(name) #endif diff -ur linux-109/include/linux/net.h linux/include/linux/net.h --- linux-109/include/linux/net.h Fri Dec 31 18:45:29 1993 +++ linux/include/linux/net.h Wed Mar 18 17:55:03 1998 @@ -22,9 +22,13 @@ #include #include - +#ifdef LOTS_OF_RAM #define NSOCKETS 128 /* should be dynamic, later... */ #define NPROTO 16 /* should be enough for now.. */ +#else +#define NSOCKETS 48 +#define NPROTO 8 +#endif #define SYS_SOCKET 1 /* sys_socket(2) */ diff -ur linux-109/include/linux/sched.h linux/include/linux/sched.h --- linux-109/include/linux/sched.h Sun Feb 15 12:31:56 1998 +++ linux/include/linux/sched.h Sun Feb 15 12:46:25 1998 @@ -357,13 +357,13 @@ * tha math co-processor latest. */ #define switch_to(tsk) \ -__asm__("cmpl %%ecx,_current\n\t" \ +__asm__("cmpl %%ecx,"SYMBOL_NAME_STR(current)"\n\t" \ "je 1f\n\t" \ "cli\n\t" \ - "xchgl %%ecx,_current\n\t" \ + "xchgl %%ecx,"SYMBOL_NAME_STR(current)"\n\t" \ "ljmp %0\n\t" \ "sti\n\t" \ - "cmpl %%ecx,_last_task_used_math\n\t" \ + "cmpl %%ecx,"SYMBOL_NAME_STR(last_task_used_math)"\n\t" \ "jne 1f\n\t" \ "clts\n" \ "1:" \ diff -ur linux-109/include/linux/string.h linux/include/linux/string.h --- linux-109/include/linux/string.h Wed Dec 1 23:44:15 1993 +++ linux/include/linux/string.h Mon Feb 16 14:51:27 1998 @@ -1,12 +1,6 @@ #ifndef _LINUX_STRING_H_ #define _LINUX_STRING_H_ -#include /* for size_t */ - -#ifndef NULL -#define NULL ((void *) 0) -#endif - /* * This string-include defines all string functions as inline * functions. Use gcc. It also assumes ds=es=data space, this should be @@ -21,7 +15,8 @@ extern inline char * strcpy(char * dest,const char *src) { -__asm__("cld\n" +__asm__ __volatile__( + "cld\n" "1:\tlodsb\n\t" "stosb\n\t" "testb %%al,%%al\n\t" @@ -33,7 +28,8 @@ extern inline char * strncpy(char * dest,const char *src,size_t count) { -__asm__("cld\n" +__asm__ __volatile__( + "cld\n" "1:\tdecl %2\n\t" "js 2f\n\t" "lodsb\n\t" @@ -50,7 +46,8 @@ extern inline char * strcat(char * dest,const char * src) { -__asm__("cld\n\t" +__asm__ __volatile__( + "cld\n\t" "repne\n\t" "scasb\n\t" "decl %1\n" @@ -65,7 +62,8 @@ extern inline char * strncat(char * dest,const char * src,size_t count) { -__asm__("cld\n\t" +__asm__ __volatile__( + "cld\n\t" "repne\n\t" "scasb\n\t" "decl %1\n\t" @@ -86,8 +84,9 @@ extern inline int strcmp(const char * cs,const char * ct) { -register int __res __asm__("ax"); -__asm__("cld\n" +register int __res; +__asm__ __volatile__( + "cld\n" "1:\tlodsb\n\t" "scasb\n\t" "jne 2f\n\t" @@ -95,18 +94,18 @@ "jne 1b\n\t" "xorl %%eax,%%eax\n\t" "jmp 3f\n" - "2:\tmovl $1,%%eax\n\t" - "jb 3f\n\t" - "negl %%eax\n" + "2:\tsbbl %%eax,%%eax\n\t" + "orb $1,%%eax\n" "3:" - :"=a" (__res):"D" (cs),"S" (ct):"si","di"); + :"=a" (__res):"S" (cs),"D" (ct):"si","di"); return __res; } extern inline int strncmp(const char * cs,const char * ct,size_t count) { -register int __res __asm__("ax"); -__asm__("cld\n" +register int __res; +__asm__ __volatile__( + "cld\n" "1:\tdecl %3\n\t" "js 2f\n\t" "lodsb\n\t" @@ -116,18 +115,18 @@ "jne 1b\n" "2:\txorl %%eax,%%eax\n\t" "jmp 4f\n" - "3:\tmovl $1,%%eax\n\t" - "jb 4f\n\t" - "negl %%eax\n" + "3:\tsbbl %%eax,%%eax\n\t" + "orb $1,%%al\n" "4:" - :"=a" (__res):"D" (cs),"S" (ct),"c" (count):"si","di","cx"); + :"=a" (__res):"S" (cs),"D" (ct),"c" (count):"si","di","cx"); return __res; } -extern inline char * strchr(const char * s,char c) +extern inline char * strchr(const char * s, int c) { -register char * __res __asm__("ax"); -__asm__("cld\n\t" +register char * __res; +__asm__ __volatile__( + "cld\n\t" "movb %%al,%%ah\n" "1:\tlodsb\n\t" "cmpb %%ah,%%al\n\t" @@ -141,16 +140,16 @@ return __res; } -extern inline char * strrchr(const char * s,char c) +extern inline char * strrchr(const char * s, int c) { -register char * __res __asm__("dx"); -__asm__("cld\n\t" +register char * __res; +__asm__ __volatile__( + "cld\n\t" "movb %%al,%%ah\n" "1:\tlodsb\n\t" "cmpb %%ah,%%al\n\t" "jne 2f\n\t" - "movl %%esi,%0\n\t" - "decl %0\n" + "leal -1(%%esi),%0\n" "2:\ttestb %%al,%%al\n\t" "jne 1b" :"=d" (__res):"0" (0),"S" (s),"a" (c):"ax","si"); @@ -159,8 +158,9 @@ extern inline size_t strspn(const char * cs, const char * ct) { -register char * __res __asm__("si"); -__asm__("cld\n\t" +register char * __res; +__asm__ __volatile__( + "cld\n\t" "movl %4,%%edi\n\t" "repne\n\t" "scasb\n\t" @@ -183,8 +183,9 @@ extern inline size_t strcspn(const char * cs, const char * ct) { -register char * __res __asm__("si"); -__asm__("cld\n\t" +register char * __res; +__asm__ __volatile__( + "cld\n\t" "movl %4,%%edi\n\t" "repne\n\t" "scasb\n\t" @@ -207,8 +208,9 @@ extern inline char * strpbrk(const char * cs,const char * ct) { -register char * __res __asm__("si"); -__asm__("cld\n\t" +register char * __res; +__asm__ __volatile__( + "cld\n\t" "movl %4,%%edi\n\t" "repne\n\t" "scasb\n\t" @@ -234,8 +236,9 @@ extern inline char * strstr(const char * cs,const char * ct) { -register char * __res __asm__("ax"); -__asm__("cld\n\t" \ +register char * __res; +__asm__ __volatile__( + "cld\n\t" \ "movl %4,%%edi\n\t" "repne\n\t" "scasb\n\t" @@ -261,8 +264,9 @@ extern inline size_t strlen(const char * s) { -register int __res __asm__("cx"); -__asm__("cld\n\t" +register int __res; +__asm__ __volatile__( + "cld\n\t" "repne\n\t" "scasb\n\t" "notl %0\n\t" @@ -276,7 +280,8 @@ extern inline char * strtok(char * s,const char * ct) { register char * __res; -__asm__("testl %1,%1\n\t" +__asm__ __volatile__( + "testl %1,%1\n\t" "jne 1f\n\t" "testl %0,%0\n\t" "je 8f\n\t" @@ -290,7 +295,7 @@ "scasb\n\t" "notl %%ecx\n\t" "decl %%ecx\n\t" - "je 7f\n\t" /* empty delimeter-string */ + "je 7f\n\t" /* empty delimiter-string */ "movl %%ecx,%%edx\n" "2:\tlodsb\n\t" "testb %%al,%%al\n\t" @@ -332,9 +337,10 @@ return __res; } -extern inline void * memcpy(void * to, const void * from, size_t n) +extern inline void * __memcpy(void * to, const void * from, size_t n) { -__asm__("cld\n\t" +__asm__ __volatile__( + "cld\n\t" "movl %%edx, %%ecx\n\t" "shrl $2,%%ecx\n\t" "rep ; movsl\n\t" @@ -351,17 +357,65 @@ return (to); } +/* + * This looks horribly ugly, but the compiler can optimize it totally, + * as the count is constant. + */ +extern inline void * __constant_memcpy(void * to, const void * from, size_t n) +{ + switch (n) { + case 0: + return to; + case 1: + *(unsigned char *)to = *(unsigned char *)from; + return to; + case 2: + *(unsigned short *)to = *(unsigned short *)from; + return to; + case 3: + *(unsigned short *)to = *(unsigned short *)from; + *(2+(unsigned char *)to) = *(2+(unsigned char *)from); + return to; + case 4: + *(unsigned long *)to = *(unsigned long *)from; + return to; + } +#define COMMON(x) \ +__asm__("cld\n\t" \ + "rep ; movsl" \ + x \ + : /* no outputs */ \ + : "c" (n/4),"D" ((long) to),"S" ((long) from) \ + : "cx","di","si","memory"); + + switch (n % 4) { + case 0: COMMON(""); return to; + case 1: COMMON("\n\tmovsb"); return to; + case 2: COMMON("\n\tmovsw"); return to; + case 3: COMMON("\n\tmovsw\n\tmovsb"); return to; + } +#undef COMMON + return NULL; /* never reached */ +} + +#define memcpy(t, f, n) \ +(__builtin_constant_p(n) ? \ + __constant_memcpy((t),(f),(n)) : \ + __memcpy((t),(f),(n))) + extern inline void * memmove(void * dest,const void * src, size_t n) { if (dest -#define NR_CONSOLES 8 -#define NR_LDISCS 16 +#define NR_CONSOLES 4 +#define NR_LDISCS 8 /* * These are set up by the setup-routine at boot-time: diff -ur linux-109/init/main.c linux/init/main.c --- linux-109/init/main.c Sun Feb 15 12:31:54 1998 +++ linux/init/main.c Mon Feb 16 19:06:53 1998 @@ -57,14 +57,13 @@ static inline _syscall1(int,close,int,fd) static inline _syscall1(int,_exit,int,exitcode) static inline _syscall3(pid_t,waitpid,pid_t,pid,int *,wait_stat,int,options) +static inline _syscall1(int,swapon,const char *,specialfile) static inline pid_t wait(int * wait_stat) { return waitpid(-1,wait_stat,0); } -static char printbuf[1024]; - extern int console_loglevel; extern char empty_zero_page[PAGE_SIZE]; @@ -135,23 +134,28 @@ static char * argv_init[MAX_INIT_ARGS+2] = { "init", NULL, }; static char * envp_init[MAX_INIT_ENVS+2] = { "HOME=/", term, NULL, }; -static char * argv_rc[] = { "/bin/sh", NULL }; -static char * envp_rc[] = { "HOME=/", term, NULL }; - -static char * argv[] = { "-/bin/sh",NULL }; -static char * envp[] = { "HOME=/usr/root", term, NULL }; - struct drive_info_struct { char dummy[32]; } drive_info; struct screen_info screen_info; unsigned char aux_device_present; + +#ifdef CONFIG_BLK_DEV_RAM int ramdisk_size; +#endif + int root_mountflags = 0; static char fpu_error = 0; static char command_line[COMMAND_LINE_SIZE] = { 0, }; +static char *swapdev; + +void swapdev_setup(char *str, int *ints) +{ + swapdev = str; +} + char *get_options(char *str, int *ints) { char *cur = str; @@ -205,6 +209,7 @@ #ifdef CONFIG_SBPCD { "sbpcd=", sbpcd_setup }, #endif CONFIG_SBPCD + { "swapdev=", swapdev_setup }, { 0, 0 } }; @@ -333,8 +338,16 @@ int len = 0; for (;;) { - if (c == ' ' && *(unsigned long *)from == *(unsigned long *)"mem=") + if (c == ' ' && *(unsigned long *)from == *(unsigned long *)"mem=") { memory_end = simple_strtoul(from+4, &from, 0); + if ( *from == 'K' || *from == 'k' ) { + memory_end = memory_end << 10; + from++; + } else if ( *from == 'M' || *from == 'm' ) { + memory_end = memory_end << 20; + from++; + } + } c = *(from++); if (!c) break; @@ -369,7 +382,9 @@ aux_device_present = AUX_DEVICE_INFO; memory_end = (1<<20) + (EXT_MEM_K<<10); memory_end &= PAGE_MASK; +#ifdef CONFIG_BLK_DEV_RAM ramdisk_size = RAMDISK_SIZE; +#endif copy_options(command_line,COMMAND_LINE); #ifdef CONFIG_MAX_16M if (memory_end > 16*1024*1024) @@ -414,7 +429,9 @@ mem_init(low_memory_start,memory_start,memory_end); buffer_init(); time_init(); +#ifdef CONFIG_BLK_DEV_FD floppy_init(); +#endif sock_init(); #ifdef CONFIG_SYSVIPC ipc_init(); @@ -474,23 +491,12 @@ idle(); } -static int printf(const char *fmt, ...) -{ - va_list args; - int i; - - va_start(args, fmt); - write(1,printbuf,i=vsprintf(printbuf, fmt, args)); - va_end(args); - return i; -} - void init(void) { - int pid,i; setup((void *) &drive_info); - sprintf(term, "TERM=con%dx%d", ORIG_VIDEO_COLS, ORIG_VIDEO_LINES); + swapon(swapdev); + sprintf(term, "TERM=linux"); (void) open("/dev/tty1",O_RDWR,0); (void) dup(0); (void) dup(0); @@ -498,36 +504,4 @@ execve("/etc/init",argv_init,envp_init); execve("/bin/init",argv_init,envp_init); execve("/sbin/init",argv_init,envp_init); - /* if this fails, fall through to original stuff */ - - if (!(pid=fork())) { - close(0); - if (open("/etc/rc",O_RDONLY,0)) - _exit(1); - execve("/bin/sh",argv_rc,envp_rc); - _exit(2); - } - if (pid>0) - while (pid != wait(&i)) - /* nothing */; - while (1) { - if ((pid = fork()) < 0) { - printf("Fork failed in init\n\r"); - continue; - } - if (!pid) { - close(0);close(1);close(2); - setsid(); - (void) open("/dev/tty1",O_RDWR,0); - (void) dup(0); - (void) dup(0); - _exit(execve("/bin/sh",argv,envp)); - } - while (1) - if (pid == wait(&i)) - break; - printf("\n\rchild %d died with code %04x\n\r",pid,i); - sync(); - } - _exit(0); } diff -ur linux-109/ipc/sem.c linux/ipc/sem.c --- linux-109/ipc/sem.c Sun Feb 15 12:31:50 1998 +++ linux/ipc/sem.c Sun Feb 15 12:46:25 1998 @@ -5,6 +5,7 @@ #include #include +#include #include #include #include diff -ur linux-109/kernel/Makefile linux/kernel/Makefile --- linux-109/kernel/Makefile Fri Dec 17 17:14:28 1993 +++ linux/kernel/Makefile Mon Feb 16 12:46:01 1998 @@ -7,29 +7,26 @@ # # Note 2! The CFLAGS definitions are now in the main makefile... -.S.s: - $(CPP) -traditional $< -o $*.s -.c.s: - $(CC) $(CFLAGS) -S $< -.s.o: - $(AS) -c -o $*.o $< +.S.o: + $(CC) -D__ASSEMBLY__ -traditional -c $< -o $*.o .c.o: $(CC) $(CFLAGS) -c $< +ifdef CONFIG_MODULES +SYMTAB_OBJS = ksyms.o +include ../versions.mk +endif + OBJS = sched.o sys_call.o traps.o irq.o dma.o fork.o \ - panic.o printk.o vsprintf.o sys.o module.o ksyms.o exit.o \ + panic.o printk.o vsprintf.o sys.o module.o exit.o \ signal.o mktime.o ptrace.o ioport.o itimer.o \ info.o ldt.o time.o all: kernel.o -kernel.o: $(OBJS) - $(LD) -r -o kernel.o $(OBJS) +kernel.o: $(OBJS) $(SYMTAB_OBJS) + $(LD) -r -o kernel.o $(OBJS) $(SYMTAB_OBJS) sync - -sys_call.s: sys_call.S - -sys_call.o: sys_call.s sched.o: sched.c $(CC) $(CFLAGS) $(PROFILING) -fno-omit-frame-pointer -c $< diff -ur linux-109/kernel/exit.c linux/kernel/exit.c --- linux-109/kernel/exit.c Sun Feb 15 12:31:56 1998 +++ linux/kernel/exit.c Mon Feb 16 18:50:00 1998 @@ -4,7 +4,7 @@ * Copyright (C) 1991, 1992 Linus Torvalds */ -#define DEBUG_PROC_TREE +#undef DEBUG_PROC_TREE #include #include diff -ur linux-109/kernel/module.c linux/kernel/module.c --- linux-109/kernel/module.c Fri Feb 11 17:55:26 1994 +++ linux/kernel/module.c Sun Feb 15 12:46:25 1998 @@ -7,6 +7,7 @@ #include #include +#ifdef CONFIG_MODULES struct module *module_list = NULL; int freeing_modules; /* true if some modules are marked for deletion */ @@ -274,3 +275,33 @@ } return p - buf; } +#else + +/* Dummy syscalls for people who don't want modules */ + +asmlinkage unsigned long sys_create_module(void) +{ + return -ENOSYS; +} + +asmlinkage int sys_init_module(void) +{ + return -ENOSYS; +} + +asmlinkage int sys_delete_module(void) +{ + return -ENOSYS; +} + +asmlinkage int sys_get_kernel_syms(void) +{ + return -ENOSYS; +} + +asmlinkage int get_module_list(char * page) +{ + return 0; +} + +#endif /* CONFIG_MODULES */ diff -ur linux-109/kernel/panic.c linux/kernel/panic.c --- linux-109/kernel/panic.c Wed Dec 1 23:44:15 1993 +++ linux/kernel/panic.c Mon Feb 16 19:06:53 1998 @@ -14,21 +14,15 @@ #include asmlinkage void sys_sync(void); /* it's really int */ +extern void unblank_screen(void); -extern int vsprintf(char * buf, const char * fmt, va_list args); - -NORET_TYPE void panic(const char * fmt, ...) +NORET_TYPE void panic_at(const void * location) { - static char buf[1024]; - va_list args; - - va_start(args, fmt); - vsprintf(buf, fmt, args); - va_end(args); - printk(KERN_EMERG "Kernel panic: %s\n",buf); + printk(KERN_EMERG "Kernel panic at: %p\n",location); if (current == task[0]) printk(KERN_EMERG "In swapper task - not syncing\n"); else sys_sync(); + unblank_screen(); for(;;); } diff -ur linux-109/kernel/printk.c linux/kernel/printk.c --- linux-109/kernel/printk.c Tue Dec 28 22:22:42 1993 +++ linux/kernel/printk.c Mon Feb 16 18:50:00 1998 @@ -20,9 +20,9 @@ #include #include -#define LOG_BUF_LEN 4096 +#define LOG_BUF_LEN 1024 -static char buf[1024]; +static char buf[256]; extern int vsprintf(char * buf, const char * fmt, va_list args); extern void console_print(const char *); diff -ur linux-109/kernel/sched.c linux/kernel/sched.c --- linux-109/kernel/sched.c Sun Feb 15 12:31:56 1998 +++ linux/kernel/sched.c Sun Feb 15 22:39:04 1998 @@ -102,55 +102,17 @@ short b; } stack_start = { & user_stack [PAGE_SIZE>>2] , KERNEL_DS }; -struct kernel_stat kstat = - { 0, 0, 0, { 0, 0, 0, 0 }, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; +struct kernel_stat kstat = { 0 }; /* * int 0x80 entry points.. Moved away from the header file, as * iBCS2 may also want to use the '' headers.. */ -#ifdef __cplusplus -extern "C" { -#endif int sys_ni_syscall(void) { return -EINVAL; } - -fn_ptr sys_call_table[] = { sys_setup, sys_exit, sys_fork, sys_read, -sys_write, sys_open, sys_close, sys_waitpid, sys_creat, sys_link, -sys_unlink, sys_execve, sys_chdir, sys_time, sys_mknod, sys_chmod, -sys_chown, sys_break, sys_stat, sys_lseek, sys_getpid, sys_mount, -sys_umount, sys_setuid, sys_getuid, sys_stime, sys_ptrace, sys_alarm, -sys_fstat, sys_pause, sys_utime, sys_stty, sys_gtty, sys_access, -sys_nice, sys_ftime, sys_sync, sys_kill, sys_rename, sys_mkdir, -sys_rmdir, sys_dup, sys_pipe, sys_times, sys_prof, sys_brk, sys_setgid, -sys_getgid, sys_signal, sys_geteuid, sys_getegid, sys_acct, sys_phys, -sys_lock, sys_ioctl, sys_fcntl, sys_mpx, sys_setpgid, sys_ulimit, -sys_olduname, sys_umask, sys_chroot, sys_ustat, sys_dup2, sys_getppid, -sys_getpgrp, sys_setsid, sys_sigaction, sys_sgetmask, sys_ssetmask, -sys_setreuid,sys_setregid, sys_sigsuspend, sys_sigpending, -sys_sethostname, sys_setrlimit, sys_getrlimit, sys_getrusage, -sys_gettimeofday, sys_settimeofday, sys_getgroups, sys_setgroups, -sys_select, sys_symlink, sys_lstat, sys_readlink, sys_uselib, -sys_swapon, sys_reboot, sys_readdir, sys_mmap, sys_munmap, sys_truncate, -sys_ftruncate, sys_fchmod, sys_fchown, sys_getpriority, sys_setpriority, -sys_profil, sys_statfs, sys_fstatfs, sys_ioperm, sys_socketcall, -sys_syslog, sys_setitimer, sys_getitimer, sys_newstat, sys_newlstat, -sys_newfstat, sys_uname, sys_iopl, sys_vhangup, sys_idle, sys_vm86, -sys_wait4, sys_swapoff, sys_sysinfo, sys_ipc, sys_fsync, sys_sigreturn, -sys_clone, sys_setdomainname, sys_newuname, sys_modify_ldt, -sys_adjtimex, sys_mprotect, sys_sigprocmask, sys_create_module, -sys_init_module, sys_delete_module, sys_get_kernel_syms, sys_quotactl, -sys_getpgid, sys_fchdir, sys_bdflush }; - -/* So we don't have to do any more manual updating.... */ -int NR_syscalls = sizeof(sys_call_table)/sizeof(fn_ptr); - -#ifdef __cplusplus -} -#endif /* * 'math_state_restore()' saves the current math information in the diff -ur linux-109/kernel/sys_call.S linux/kernel/sys_call.S --- linux-109/kernel/sys_call.S Wed Dec 1 23:44:15 1993 +++ linux/kernel/sys_call.S Mon Feb 16 14:37:13 1998 @@ -40,7 +40,9 @@ * 40(%esp) - %oldss */ +#include #include +#include EBX = 0x00 ECX = 0x04 @@ -77,18 +79,10 @@ errno = 24 dbgreg6 = 52 dbgreg7 = 56 +exec_domain = 60 ENOSYS = 38 -.globl _system_call,_lcall7 -.globl _device_not_available, _coprocessor_error -.globl _divide_error,_debug,_nmi,_int3,_overflow,_bounds,_invalid_op -.globl _double_fault,_coprocessor_segment_overrun -.globl _invalid_TSS,_segment_not_present,_stack_segment -.globl _general_protection,_reserved -.globl _alignment_check,_page_fault -.globl ret_from_sys_call - #define SAVE_ALL \ cld; \ push %gs; \ @@ -111,7 +105,7 @@ #define RESTORE_ALL \ cmpw $(KERNEL_CS),CS(%esp); \ je 1f; \ - movl _current,%eax; \ + movl SYMBOL_NAME(current),%eax; \ movl dbgreg7(%eax),%ebx; \ movl %ebx,%db7; \ 1: popl %ebx; \ @@ -128,8 +122,7 @@ addl $4,%esp; \ iret -.align 4 -_lcall7: +ENTRY(lcall7) pushfl # We get a different stack layout with call gates, pushl %eax # which has to be cleaned up later.. SAVE_ALL @@ -140,39 +133,45 @@ movl %edx,EIP(%esp) # Now we move them to their "normal" places movl %ecx,CS(%esp) # movl %esp,%eax + movl SYMBOL_NAME(current),%edx pushl %eax - call _iABI_emulate + movl exec_domain(%edx),%edx # Get the execution domain + movl 4(%edx),%edx # Get the lcall7 handler for the domain + call *%edx popl %eax jmp ret_from_sys_call -.align 4 + ALIGN handle_bottom_half: pushfl - incl _intr_count + incl SYMBOL_NAME(intr_count) sti - call _do_bottom_half + call SYMBOL_NAME(do_bottom_half) popfl - decl _intr_count + decl SYMBOL_NAME(intr_count) jmp 9f -.align 4 + ALIGN reschedule: pushl $ret_from_sys_call - jmp _schedule -.align 4 -_system_call: + jmp SYMBOL_NAME(schedule) + +ENTRY(system_call) pushl %eax # save orig_eax SAVE_ALL movl $-ENOSYS,EAX(%esp) - cmpl _NR_syscalls,%eax + cmpl $(NR_syscalls),%eax jae ret_from_sys_call - movl _current,%ebx + movl SYMBOL_NAME(sys_call_table)(,%eax,4),%eax + testl %eax,%eax + je ret_from_sys_call + movl SYMBOL_NAME(current),%ebx andl $~CF_MASK,EFLAGS(%esp) # clear carry - assume no errors movl $0,errno(%ebx) movl %db6,%edx movl %edx,dbgreg6(%ebx) # save current hardware debugging status testb $0x20,flags(%ebx) # PF_TRACESYS jne 1f - call _sys_call_table(,%eax,4) + call *%eax movl %eax,EAX(%esp) # save the return value movl errno(%ebx),%edx negl %edx @@ -180,27 +179,28 @@ movl %edx,EAX(%esp) orl $(CF_MASK),EFLAGS(%esp) # set carry to indicate error jmp ret_from_sys_call -.align 4 -1: call _syscall_trace + ALIGN +1: call SYMBOL_NAME(syscall_trace) movl ORIG_EAX(%esp),%eax - call _sys_call_table(,%eax,4) + call SYMBOL_NAME(sys_call_table)(,%eax,4) movl %eax,EAX(%esp) # save the return value - movl _current,%eax + movl SYMBOL_NAME(current),%eax movl errno(%eax),%edx negl %edx je 1f movl %edx,EAX(%esp) orl $(CF_MASK),EFLAGS(%esp) # set carry to indicate error -1: call _syscall_trace +1: call SYMBOL_NAME(syscall_trace) - .align 4,0x90 + ALIGN + .globl ret_from_sys_call ret_from_sys_call: - cmpl $0,_intr_count + cmpl $0,SYMBOL_NAME(intr_count) jne 2f - movl _bh_mask,%eax - andl _bh_active,%eax +9: movl SYMBOL_NAME(bh_mask),%eax + andl SYMBOL_NAME(bh_active),%eax jne handle_bottom_half -9: movl EFLAGS(%esp),%eax # check VM86 flag: CS/SS are + movl EFLAGS(%esp),%eax # check VM86 flag: CS/SS are testl $(VM_MASK),%eax # different then jne 1f cmpw $(KERNEL_CS),CS(%esp) # was old code segment supervisor ? @@ -209,10 +209,10 @@ orl $(IF_MASK),%eax # these just try to make sure andl $~NT_MASK,%eax # the program doesn't do anything movl %eax,EFLAGS(%esp) # stupid - cmpl $0,_need_resched + cmpl $0,SYMBOL_NAME(need_resched) jne reschedule - movl _current,%eax - cmpl _task,%eax # task[0] cannot have signals + movl SYMBOL_NAME(current),%eax + cmpl SYMBOL_NAME(task),%eax # task[0] cannot have signals je 2f cmpl $0,state(%eax) # state jne reschedule @@ -224,33 +224,32 @@ andl signal(%eax),%ecx jne signal_return 2: RESTORE_ALL -.align 4 + ALIGN signal_return: movl %esp,%ecx pushl %ecx testl $(VM_MASK),EFLAGS(%ecx) jne v86_signal_return pushl %ebx - call _do_signal + call SYMBOL_NAME(do_signal) popl %ebx popl %ebx RESTORE_ALL -.align 4 + ALIGN v86_signal_return: - call _save_v86_state + call SYMBOL_NAME(save_v86_state) movl %eax,%esp pushl %eax pushl %ebx - call _do_signal + call SYMBOL_NAME(do_signal) popl %ebx popl %ebx RESTORE_ALL -.align 4 -_divide_error: +ENTRY(divide_error) pushl $0 # no error code - pushl $_do_divide_error -.align 4,0x90 + pushl $ SYMBOL_NAME(do_divide_error) + ALIGN error_code: push %fs push %es @@ -279,7 +278,7 @@ movl $(USER_DS),%edx mov %dx,%fs pushl %eax - movl _current,%eax + movl SYMBOL_NAME(current),%eax movl %db6,%edx movl %edx,dbgreg6(%eax) # save current hardware debugging status popl %eax @@ -287,104 +286,231 @@ addl $8,%esp jmp ret_from_sys_call -.align 4 -_coprocessor_error: +ENTRY(coprocessor_error) pushl $0 - pushl $_do_coprocessor_error + pushl $ SYMBOL_NAME(do_coprocessor_error) jmp error_code -.align 4 -_device_not_available: +ENTRY(device_not_available) pushl $-1 # mark this as an int SAVE_ALL pushl $ret_from_sys_call movl %cr0,%eax testl $0x4,%eax # EM (math emulation bit) - je _math_state_restore + je SYMBOL_NAME(math_state_restore) pushl $0 # temporary storage for ORIG_EIP - call _math_emulate + call SYMBOL_NAME(math_emulate) addl $4,%esp ret -.align 4 -_debug: +ENTRY(debug) pushl $0 - pushl $_do_debug + pushl $ SYMBOL_NAME(do_debug) jmp error_code -.align 4 -_nmi: +ENTRY(nmi) pushl $0 - pushl $_do_nmi + pushl $ SYMBOL_NAME(do_nmi) jmp error_code -.align 4 -_int3: +ENTRY(int3) pushl $0 - pushl $_do_int3 + pushl $ SYMBOL_NAME(do_int3) jmp error_code -.align 4 -_overflow: +ENTRY(overflow) pushl $0 - pushl $_do_overflow + pushl $ SYMBOL_NAME(do_overflow) jmp error_code -.align 4 -_bounds: +ENTRY(bounds) pushl $0 - pushl $_do_bounds + pushl $ SYMBOL_NAME(do_bounds) jmp error_code -.align 4 -_invalid_op: +ENTRY(invalid_op) pushl $0 - pushl $_do_invalid_op + pushl $ SYMBOL_NAME(do_invalid_op) jmp error_code -.align 4 -_coprocessor_segment_overrun: +ENTRY(coprocessor_segment_overrun) pushl $0 - pushl $_do_coprocessor_segment_overrun + pushl $ SYMBOL_NAME(do_coprocessor_segment_overrun) jmp error_code -.align 4 -_reserved: +ENTRY(reserved) pushl $0 - pushl $_do_reserved - jmp error_code - -.align 4 -_double_fault: - pushl $_do_double_fault - jmp error_code - -.align 4 -_invalid_TSS: - pushl $_do_invalid_TSS + pushl $ SYMBOL_NAME(do_reserved) jmp error_code -.align 4 -_segment_not_present: - pushl $_do_segment_not_present +ENTRY(double_fault) + pushl $ SYMBOL_NAME(do_double_fault) jmp error_code -.align 4 -_stack_segment: - pushl $_do_stack_segment - jmp error_code - -.align 4 -_general_protection: - pushl $_do_general_protection - jmp error_code - -.align 4 -_alignment_check: - pushl $_do_alignment_check - jmp error_code - -.align 4 -_page_fault: - pushl $_do_page_fault - jmp error_code +ENTRY(invalid_TSS) + pushl $ SYMBOL_NAME(do_invalid_TSS) + jmp error_code + +ENTRY(segment_not_present) + pushl $ SYMBOL_NAME(do_segment_not_present) + jmp error_code + +ENTRY(stack_segment) + pushl $ SYMBOL_NAME(do_stack_segment) + jmp error_code + +ENTRY(general_protection) + pushl $ SYMBOL_NAME(do_general_protection) + jmp error_code + +ENTRY(alignment_check) + pushl $ SYMBOL_NAME(do_alignment_check) + jmp error_code + +ENTRY(page_fault) + pushl $ SYMBOL_NAME(do_page_fault) + jmp error_code + +.data +ENTRY(sys_call_table) + .long SYMBOL_NAME(sys_setup) /* 0 */ + .long SYMBOL_NAME(sys_exit) + .long SYMBOL_NAME(sys_fork) + .long SYMBOL_NAME(sys_read) + .long SYMBOL_NAME(sys_write) + .long SYMBOL_NAME(sys_open) /* 5 */ + .long SYMBOL_NAME(sys_close) + .long SYMBOL_NAME(sys_waitpid) + .long SYMBOL_NAME(sys_creat) + .long SYMBOL_NAME(sys_link) + .long SYMBOL_NAME(sys_unlink) /* 10 */ + .long SYMBOL_NAME(sys_execve) + .long SYMBOL_NAME(sys_chdir) + .long SYMBOL_NAME(sys_time) + .long SYMBOL_NAME(sys_mknod) + .long SYMBOL_NAME(sys_chmod) /* 15 */ + .long SYMBOL_NAME(sys_chown) + .long SYMBOL_NAME(sys_break) + .long SYMBOL_NAME(sys_stat) + .long SYMBOL_NAME(sys_lseek) + .long SYMBOL_NAME(sys_getpid) /* 20 */ + .long SYMBOL_NAME(sys_mount) + .long SYMBOL_NAME(sys_umount) + .long SYMBOL_NAME(sys_setuid) + .long SYMBOL_NAME(sys_getuid) + .long SYMBOL_NAME(sys_stime) /* 25 */ + .long SYMBOL_NAME(sys_ptrace) + .long SYMBOL_NAME(sys_alarm) + .long SYMBOL_NAME(sys_fstat) + .long SYMBOL_NAME(sys_pause) + .long SYMBOL_NAME(sys_utime) /* 30 */ + .long SYMBOL_NAME(sys_stty) + .long SYMBOL_NAME(sys_gtty) + .long SYMBOL_NAME(sys_access) + .long SYMBOL_NAME(sys_nice) + .long SYMBOL_NAME(sys_ftime) /* 35 */ + .long SYMBOL_NAME(sys_sync) + .long SYMBOL_NAME(sys_kill) + .long SYMBOL_NAME(sys_rename) + .long SYMBOL_NAME(sys_mkdir) + .long SYMBOL_NAME(sys_rmdir) /* 40 */ + .long SYMBOL_NAME(sys_dup) + .long SYMBOL_NAME(sys_pipe) + .long SYMBOL_NAME(sys_times) + .long SYMBOL_NAME(sys_prof) + .long SYMBOL_NAME(sys_brk) /* 45 */ + .long SYMBOL_NAME(sys_setgid) + .long SYMBOL_NAME(sys_getgid) + .long SYMBOL_NAME(sys_signal) + .long SYMBOL_NAME(sys_geteuid) + .long SYMBOL_NAME(sys_getegid) /* 50 */ + .long SYMBOL_NAME(sys_acct) + .long SYMBOL_NAME(sys_phys) + .long SYMBOL_NAME(sys_lock) + .long SYMBOL_NAME(sys_ioctl) + .long SYMBOL_NAME(sys_fcntl) /* 55 */ + .long SYMBOL_NAME(sys_mpx) + .long SYMBOL_NAME(sys_setpgid) + .long SYMBOL_NAME(sys_ulimit) + .long SYMBOL_NAME(sys_olduname) + .long SYMBOL_NAME(sys_umask) /* 60 */ + .long SYMBOL_NAME(sys_chroot) + .long SYMBOL_NAME(sys_ustat) + .long SYMBOL_NAME(sys_dup2) + .long SYMBOL_NAME(sys_getppid) + .long SYMBOL_NAME(sys_getpgrp) /* 65 */ + .long SYMBOL_NAME(sys_setsid) + .long SYMBOL_NAME(sys_sigaction) + .long SYMBOL_NAME(sys_sgetmask) + .long SYMBOL_NAME(sys_ssetmask) + .long SYMBOL_NAME(sys_setreuid) /* 70 */ + .long SYMBOL_NAME(sys_setregid) + .long SYMBOL_NAME(sys_sigsuspend) + .long SYMBOL_NAME(sys_sigpending) + .long SYMBOL_NAME(sys_sethostname) + .long SYMBOL_NAME(sys_setrlimit) /* 75 */ + .long SYMBOL_NAME(sys_getrlimit) + .long SYMBOL_NAME(sys_getrusage) + .long SYMBOL_NAME(sys_gettimeofday) + .long SYMBOL_NAME(sys_settimeofday) + .long SYMBOL_NAME(sys_getgroups) /* 80 */ + .long SYMBOL_NAME(sys_setgroups) + .long SYMBOL_NAME(sys_select) + .long SYMBOL_NAME(sys_symlink) + .long SYMBOL_NAME(sys_lstat) + .long SYMBOL_NAME(sys_readlink) /* 85 */ + .long SYMBOL_NAME(sys_uselib) + .long SYMBOL_NAME(sys_swapon) + .long SYMBOL_NAME(sys_reboot) + .long SYMBOL_NAME(sys_readdir) + .long SYMBOL_NAME(sys_mmap) /* 90 */ + .long SYMBOL_NAME(sys_munmap) + .long SYMBOL_NAME(sys_truncate) + .long SYMBOL_NAME(sys_ftruncate) + .long SYMBOL_NAME(sys_fchmod) + .long SYMBOL_NAME(sys_fchown) /* 95 */ + .long SYMBOL_NAME(sys_getpriority) + .long SYMBOL_NAME(sys_setpriority) + .long SYMBOL_NAME(sys_profil) + .long SYMBOL_NAME(sys_statfs) + .long SYMBOL_NAME(sys_fstatfs) /* 100 */ + .long SYMBOL_NAME(sys_ioperm) + .long SYMBOL_NAME(sys_socketcall) + .long SYMBOL_NAME(sys_syslog) + .long SYMBOL_NAME(sys_setitimer) + .long SYMBOL_NAME(sys_getitimer) /* 105 */ + .long SYMBOL_NAME(sys_newstat) + .long SYMBOL_NAME(sys_newlstat) + .long SYMBOL_NAME(sys_newfstat) + .long SYMBOL_NAME(sys_uname) + .long SYMBOL_NAME(sys_iopl) /* 110 */ + .long SYMBOL_NAME(sys_vhangup) + .long SYMBOL_NAME(sys_idle) + .long SYMBOL_NAME(sys_vm86) + .long SYMBOL_NAME(sys_wait4) + .long SYMBOL_NAME(sys_swapoff) /* 115 */ + .long SYMBOL_NAME(sys_sysinfo) + .long SYMBOL_NAME(sys_ipc) + .long SYMBOL_NAME(sys_fsync) + .long SYMBOL_NAME(sys_sigreturn) + .long SYMBOL_NAME(sys_clone) /* 120 */ + .long SYMBOL_NAME(sys_setdomainname) + .long SYMBOL_NAME(sys_newuname) + .long SYMBOL_NAME(sys_modify_ldt) + .long SYMBOL_NAME(sys_adjtimex) + .long SYMBOL_NAME(sys_mprotect) /* 125 */ + .long SYMBOL_NAME(sys_sigprocmask) + .long SYMBOL_NAME(sys_create_module) + .long SYMBOL_NAME(sys_init_module) + .long SYMBOL_NAME(sys_delete_module) + .long SYMBOL_NAME(sys_get_kernel_syms) /* 130 */ + .long SYMBOL_NAME(sys_quotactl) + .long SYMBOL_NAME(sys_getpgid) + .long SYMBOL_NAME(sys_fchdir) + .long SYMBOL_NAME(sys_bdflush) + .long SYMBOL_NAME(sys_sysfs) /* 135 */ + .long SYMBOL_NAME(sys_personality) + .long 0 /* for afs_syscall */ + .long SYMBOL_NAME(sys_setfsuid) + .long SYMBOL_NAME(sys_setfsgid) + .long SYMBOL_NAME(sys_llseek) /* 140 */ diff -ur linux-109/lib/Makefile linux/lib/Makefile --- linux-109/lib/Makefile Wed Dec 1 23:44:15 1993 +++ linux/lib/Makefile Sun Feb 15 12:46:25 1998 @@ -9,7 +9,7 @@ .c.s: $(CC) $(CFLAGS) -S $< .s.o: - $(AS) -c -o $*.o $< + $(AS) -o $*.o $< .c.o: $(CC) $(CFLAGS) -c $< diff -ur linux-109/mm/mmap.c linux/mm/mmap.c --- linux-109/mm/mmap.c Fri Feb 4 20:59:35 1994 +++ linux/mm/mmap.c Sun Feb 15 19:01:55 1998 @@ -51,6 +51,13 @@ return -EINVAL; /* + * XXX - Why is the load_elf_lib routine calling us + * with PROT_NONE ? + */ + if (prot == PROT_NONE) + prot = (PROT_READ | PROT_WRITE | PROT_EXEC); + + /* * do simple checking here so the lower-level routines won't have * to. we assume access permissions have been handled by the open * of the memory object, so we don't do any here. @@ -229,7 +236,11 @@ asmlinkage int sys_mprotect(unsigned long addr, size_t len, unsigned long prot) { - return -EINVAL; /* Not implemented yet */ + /* + * Not implemented here, but lie and return zero to fake success + * and be like the newer kernels + */ + return 0; } asmlinkage int sys_munmap(unsigned long addr, size_t len) diff -ur linux-109/mm/swap.c linux/mm/swap.c --- linux-109/mm/swap.c Sun Feb 15 12:31:56 1998 +++ linux/mm/swap.c Tue Feb 17 00:44:04 1998 @@ -21,7 +21,7 @@ #include /* for cli()/sti() */ #include -#define MAX_SWAPFILES 8 +#define MAX_SWAPFILES 3 #define SWP_USED 1 #define SWP_WRITEOK 3 @@ -271,6 +271,7 @@ */ asmlinkage int sys_idle(void) { + __asm__("hlt"); /* We're green! :) */ need_resched = 1; return 0; } @@ -293,8 +294,8 @@ * These are the miminum and maximum number of pages to swap from one process, * before proceeding to the next: */ -#define SWAP_MIN 4 -#define SWAP_MAX 32 +#define SWAP_MIN 2 +#define SWAP_MAX 256 /* * The actual number of pages to swap is determined as: diff -ur linux-109/net/inet/datagram.c linux/net/inet/datagram.c --- linux-109/net/inet/datagram.c Fri Feb 11 18:14:40 1994 +++ linux/net/inet/datagram.c Sun Feb 15 12:46:25 1998 @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include diff -ur linux-109/net/inet/icmp.c linux/net/inet/icmp.c --- linux-109/net/inet/icmp.c Sun Feb 15 12:31:57 1998 +++ linux/net/inet/icmp.c Sun Feb 15 12:46:25 1998 @@ -27,6 +27,7 @@ #include #include #include +#include #include #include "inet.h" #include "dev.h" diff -ur linux-109/net/inet/loopback.c linux/net/inet/loopback.c --- linux-109/net/inet/loopback.c Wed Jan 19 22:27:09 1994 +++ linux/net/inet/loopback.c Sun Feb 15 12:46:26 1998 @@ -72,14 +72,14 @@ dev->tbusy = 0; #if 1 - __asm__("cmpl $0,_intr_count\n\t" + __asm__("cmpl $0,"SYMBOL_NAME_STR(intr_count)"\n\t" "jne 1f\n\t" - "movl _bh_active,%%eax\n\t" - "testl _bh_mask,%%eax\n\t" + "movl "SYMBOL_NAME_STR(bh_active)",%%eax\n\t" + "testl "SYMBOL_NAME_STR(bh_mask)",%%eax\n\t" "je 1f\n\t" - "incl _intr_count\n\t" - "call _do_bottom_half\n\t" - "decl _intr_count\n" + "incl "SYMBOL_NAME_STR(intr_count)"\n\t" + "call "SYMBOL_NAME_STR(do_bottom_half)"\n\t" + "decl "SYMBOL_NAME_STR(intr_count)"\n" "1:" : : diff -ur linux-109/net/inet/packet.c linux/net/inet/packet.c --- linux-109/net/inet/packet.c Tue Feb 1 01:35:36 1994 +++ linux/net/inet/packet.c Sun Feb 15 12:46:26 1998 @@ -30,6 +30,7 @@ #include #include #include +#include #include #include "inet.h" #include "dev.h" diff -ur linux-109/net/inet/raw.c linux/net/inet/raw.c --- linux-109/net/inet/raw.c Sun Feb 6 21:17:40 1994 +++ linux/net/inet/raw.c Sun Feb 15 19:11:32 1998 @@ -39,6 +39,7 @@ #include #include #include +#include #include #include "inet.h" #include "dev.h" @@ -74,7 +75,7 @@ if (sk == NULL) return; /* This is meaningless in raw sockets. */ - if (err & 0xff00 == (ICMP_SOURCE_QUENCH << 8)) { + if ((err & 0xff00) == (ICMP_SOURCE_QUENCH << 8)) { if (sk->cong_window > 1) sk->cong_window = sk->cong_window/2; return; } diff -ur linux-109/net/inet/skbuff.c linux/net/inet/skbuff.c --- linux-109/net/inet/skbuff.c Sun Feb 15 12:31:56 1998 +++ linux/net/inet/skbuff.c Sun Feb 15 12:46:26 1998 @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include diff -ur linux-109/net/inet/udp.c linux/net/inet/udp.c --- linux-109/net/inet/udp.c Tue Jan 25 17:51:48 1994 +++ linux/net/inet/udp.c Sun Feb 15 19:12:06 1998 @@ -49,6 +49,7 @@ #include #include #include +#include #include #include #include @@ -119,7 +120,7 @@ return; } - if (err & 0xff00 ==(ICMP_SOURCE_QUENCH << 8)) { /* Slow down! */ + if ((err & 0xff00) == (ICMP_SOURCE_QUENCH << 8)) { /* Slow down! */ if (sk->cong_window > 1) sk->cong_window = sk->cong_window/2; return; diff -ur linux-109/net/unix/Makefile linux/net/unix/Makefile --- linux-109/net/unix/Makefile Wed Dec 1 23:44:15 1993 +++ linux/net/unix/Makefile Mon Feb 16 19:06:53 1998 @@ -16,7 +16,11 @@ $(CC) $(CFLAGS) \ -S -o $*.s $< -OBJS = sock.o proc.o +OBJS = sock.o + +ifdef CONFIG_PROC_FS +OBJS := $(OBJS) proc.o +endif unix.o: $(OBJS) $(LD) -r -o unix.o $(OBJS) diff -ur linux-109/net/unix/proc.c linux/net/unix/proc.c --- linux-109/net/unix/proc.c Fri Mar 4 18:25:21 1994 +++ linux/net/unix/proc.c Mon Feb 16 19:06:53 1998 @@ -23,7 +23,6 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ -#include #include #include #include diff -ur linux-109/tools/build.c linux/tools/build.c --- linux-109/tools/build.c Wed Dec 29 15:50:28 1993 +++ linux/tools/build.c Sun Feb 15 12:46:26 1998 @@ -31,8 +31,12 @@ #include #include +#include + #define MINIX_HEADER 32 -#define GCC_HEADER 1024 +#ifndef __BFD__ +static int GCC_HEADER = sizeof(struct exec); +#endif #define SYS_SIZE DEF_SYSSIZE @@ -87,7 +91,9 @@ int i,c,id, sz; unsigned long sys_size; char buf[1024]; +#ifndef __BFD__ struct exec *ex = (struct exec *)buf; +#endif char major_root, minor_root; struct stat sb; @@ -186,6 +192,7 @@ if ((id=open(argv[3],O_RDONLY,0))<0) die("Unable to open 'system'"); +#ifndef __BFD__ if (read(id,buf,GCC_HEADER) != GCC_HEADER) die("Unable to read header of 'system'"); if (N_MAGIC(*ex) != ZMAGIC) @@ -196,6 +203,14 @@ ex->a_data /1024, ex->a_bss /1024); sz = N_SYMOFF(*ex) - GCC_HEADER + 4; +#else + if (fstat (id, &sb)) { + perror ("fstat"); + die ("Unable to stat 'system'"); + } + sz = sb.st_size; + fprintf (stderr, "System is %d kB\n", sz/1024); +#endif sys_size = (sz + 15) / 16; if (sys_size > SYS_SIZE) die("System is too big"); diff -ur linux-109/zBoot/Makefile linux/zBoot/Makefile --- linux-109/zBoot/Makefile Wed Mar 9 19:11:16 1994 +++ linux/zBoot/Makefile Wed Mar 18 17:34:55 1998 @@ -4,29 +4,58 @@ #LD = gcc #TEST = -DTEST_DRIVER -zOBJECTS = $(HEAD) inflate.o unzip.o misc.o +OBJECTS = $(HEAD) inflate.o unzip.o misc.o CFLAGS = -O2 -DSTDC_HEADERS $(TEST) +ifeq ($(USE_ELF),yes) +TARGET=--target elf32-i386 +INPUT_DATA=input_data +INPUT_LEN=input_len +endif + .c.s: $(CC) $(CFLAGS) -S -o $*.s $< .s.o: - $(AS) -c -o $*.o $< + $(AS) -o $*.o $< .c.o: $(CC) $(CFLAGS) -c -o $*.o $< all: zSystem -zSystem: piggy.o $(zOBJECTS) - $(LD) $(LDFLAGS) -o zSystem -Ttext 1000 $(zOBJECTS) piggy.o +zSystem: piggy.o $(OBJECTS) + $(LD) $(LDFLAGS) -o zSystem -Ttext 1000 $(OBJECTS) piggy.o -head.o: head.s +vmlinux: piggy.o $(OBJECTS) + $(LD) $(ZLINKFLAGS) -o vmlinux $(OBJECTS) piggy.o -head.s: head.S ../include/linux/tasks.h - $(CPP) -traditional head.S -o head.s +head.o: head.S $(TOPDIR)/include/linux/tasks.h + $(CC) -traditional -c head.S +ifeq ($(USE_ELF),yes) + +# You cannot compress a file and have the kernel uncompress it, it must +# be stdin +piggy.o: $(SYSTEM) + tmppiggy=/tmp/$$$$piggy; \ + rm -f $$tmppiggy $$tmppiggy.gz $$tmppiggy.lnk; \ + if hash $(ENCAPS) 2> /dev/null; then \ + $(OBJDUMP) $(OBJDUMP_FLAGS) -o $(IMAGE_OFFSET) $(SYSTEM) > $$tmppiggy; \ + else \ + $(OBJCOPY) $(SYSTEM) $$tmppiggy; \ + fi ; \ + gzip -f -9 < $$tmppiggy > $$tmppiggy.gz; \ + if hash $(ENCAPS) 2> /dev/null; then \ + $(ENCAPS) $(TARGET) piggy.o $$tmppiggy.gz $(INPUT_DATA) $(INPUT_LEN); \ + else \ + echo "SECTIONS { .data : { input_len = .; LONG(input_data_end - input_data) input_data = .; *(.data) input_data_end = .; }}" > $$tmppiggy.lnk; \ + $(LD) -m elf_i386 -r -o piggy.o -b binary $$tmppiggy.gz -b elf32-i386 -T $$tmppiggy.lnk; \ + fi; \ + rm -f $$tmppiggy $$tmppiggy.gz $$tmppiggy.lnk +else piggy.o: $(SYSTEM) xtract piggyback ./xtract $(SYSTEM) | gzip -9 | ./piggyback > piggy.o +endif $(SYSTEM): $(MAKE) -C .. tools/zSystem diff -ur linux-109/zBoot/head.S linux/zBoot/head.S --- linux-109/zBoot/head.S Wed Dec 1 23:44:15 1993 +++ linux/zBoot/head.S Sun Feb 15 12:46:26 1998 @@ -19,8 +19,9 @@ .text #include +#include -startup_32: +ENTRY(startup_32) cld cli movl $(KERNEL_DS),%eax @@ -28,7 +29,7 @@ mov %ax,%es mov %ax,%fs mov %ax,%gs - lss _stack_start,%esp + lss SYMBOL_NAME(stack_start),%esp xorl %eax,%eax 1: incl %eax # check that A20 really IS enabled movl %eax,0x000000 # loop forever if it isn't @@ -45,8 +46,8 @@ * Clear BSS */ xorl %eax,%eax - movl $__edata,%edi - movl $__end,%ecx + movl $ SYMBOL_NAME(_edata),%edi + movl $ SYMBOL_NAME(_end),%ecx subl %edi,%ecx cld rep @@ -54,5 +55,5 @@ /* * Do the decompression, and jump to the new kernel.. */ - call _decompress_kernel + call SYMBOL_NAME(decompress_kernel) ljmp $(KERNEL_CS), $0x100000