diff -u --recursive --new-file linux-1.3.74-orig/Makefile linux/Makefile --- linux-1.3.74-orig/Makefile Fri Mar 15 06:59:56 1996 +++ linux/Makefile Fri Mar 15 06:01:18 1996 @@ -2,7 +2,7 @@ PATCHLEVEL = 3 SUBLEVEL = 74 -ARCH = i386 +ARCH = alpha # # For SMP kernels, set this. We don't want to have this in the config file diff -u --recursive --new-file linux-1.3.74-orig/arch/alpha/Makefile linux/arch/alpha/Makefile --- linux-1.3.74-orig/arch/alpha/Makefile Fri Mar 15 06:56:26 1996 +++ linux/arch/alpha/Makefile Fri Mar 15 05:38:22 1996 @@ -42,6 +42,12 @@ msb my-special-boot: @$(MAKEBOOT) msb +bootimage: + @$(MAKEBOOT) bootimage + +srmboot: + @$(MAKEBOOT) srmboot + archclean: @$(MAKEBOOT) clean diff -u --recursive --new-file linux-1.3.74-orig/arch/alpha/boot/Makefile linux/arch/alpha/boot/Makefile --- linux-1.3.74-orig/arch/alpha/boot/Makefile Thu Nov 9 03:04:33 1995 +++ linux/arch/alpha/boot/Makefile Fri Mar 15 05:51:35 1996 @@ -34,6 +34,17 @@ ( cat tools/lxboot tools/bootlx vmlinux.nh ) > /dev/rz0a disklabel -rw rz0 'linux' tools/lxboot tools/bootlx +bootimage: tools/mkbb tools/lxboot tools/bootlx vmlinux.nh + ( cat tools/lxboot tools/bootlx vmlinux.nh ) > bootimage + tools/mkbb bootimage tools/lxboot + +srmboot: bootdevice bootimage + dd if=bootimage of=$(BOOTDEV) bs=512 seek=1 skip=1 + tools/mkbb $(BOOTDEV) tools/lxboot + +bootdevice: + @test "$(BOOTDEV)" != "" || (echo You must specify BOOTDEV ; exit -1) + vmlinux.gz: vmlinux gzip -fv vmlinux @@ -56,6 +67,9 @@ tools/build: tools/build.c $(HOSTCC) tools/build.c -o tools/build +tools/mkbb: tools/mkbb.c + $(HOSTCC) tools/mkbb.c -o tools/mkbb + bootloader: $(OBJECTS) $(LD) $(LINKFLAGS) \ $(OBJECTS) \ @@ -64,6 +78,7 @@ (rm -f bootloader && exit 1) clean: - rm -f $(TARGETS) bootloader tools/build + rm -f $(TARGETS) bootloader bootimage vmlinux.nh tools/build \ + tools/mkbb tools/bootlx tools/lxboot dep: diff -u --recursive --new-file linux-1.3.74-orig/arch/alpha/boot/head.S linux/arch/alpha/boot/head.S --- linux-1.3.74-orig/arch/alpha/boot/head.S Mon Jan 16 00:17:34 1995 +++ linux/arch/alpha/boot/head.S Thu Mar 14 09:19:05 1996 @@ -129,3 +129,11 @@ ret $31,($26) .end dispatch + .align 3 + .globl tbi + .ent tbi +tbi: + .long PAL_tbi + ret ($26) + .end tbi + diff -u --recursive --new-file linux-1.3.74-orig/arch/alpha/boot/main.c linux/arch/alpha/boot/main.c --- linux-1.3.74-orig/arch/alpha/boot/main.c Fri Dec 15 00:31:29 1995 +++ linux/arch/alpha/boot/main.c Thu Mar 14 09:19:05 1996 @@ -13,6 +13,7 @@ #include #include #include +#include #include diff -u --recursive --new-file linux-1.3.74-orig/arch/alpha/boot/tools/mkbb.c linux/arch/alpha/boot/tools/mkbb.c --- linux-1.3.74-orig/arch/alpha/boot/tools/mkbb.c Wed Dec 31 19:00:00 1969 +++ linux/arch/alpha/boot/tools/mkbb.c Thu Mar 14 09:19:05 1996 @@ -0,0 +1,151 @@ +/* This utility makes a bootblock suitable for the SRM console/miniloader */ + +/* Usage: + * mkbb + * + * Where is the name of the device to install the bootblock on, + * and is the name of a bootblock to merge in. This bootblock + * contains the offset and size of the bootloader. It must be exactly + * 512 bytes long. + */ + +#include +#include +#include + +/* Minimal definition of disklabel, so we don't have to include + * asm/disklabel.h (confuses make) + */ +#ifndef MAXPARTITIONS +#define MAXPARTITIONS 8 /* max. # of partitions */ +#endif + +#ifndef u8 +#define u8 unsigned char +#endif + +#ifndef u16 +#define u16 unsigned short +#endif + +#ifndef u32 +#define u32 unsigned int +#endif + +struct disklabel { + u32 d_magic; /* must be DISKLABELMAGIC */ + u16 d_type, d_subtype; + u8 d_typename[16]; + u8 d_packname[16]; + u32 d_secsize; + u32 d_nsectors; + u32 d_ntracks; + u32 d_ncylinders; + u32 d_secpercyl; + u32 d_secprtunit; + u16 d_sparespertrack; + u16 d_sparespercyl; + u32 d_acylinders; + u16 d_rpm, d_interleave, d_trackskew, d_cylskew; + u32 d_headswitch, d_trkseek, d_flags; + u32 d_drivedata[5]; + u32 d_spare[5]; + u32 d_magic2; /* must be DISKLABELMAGIC */ + u16 d_checksum; + u16 d_npartitions; + u32 d_bbsize, d_sbsize; + struct d_partition { + u32 p_size; + u32 p_offset; + u32 p_fsize; + u8 p_fstype; + u8 p_frag; + u16 p_cpg; + } d_partitions[MAXPARTITIONS]; +}; + + +typedef union __bootblock { + struct { + char __pad1[64]; + struct disklabel __label; + } __u1; + struct { + unsigned long __pad2[63]; + unsigned long __checksum; + } __u2; + char bootblock_bytes[512]; + unsigned long bootblock_quadwords[64]; +} bootblock; + +#define bootblock_label __u1.__label +#define bootblock_checksum __u2.__checksum + +main(int argc, char ** argv) +{ + bootblock bootblock_from_disk; + bootblock bootloader_image; + int dev, fd; + int i; + int nread; + + /* Make sure of the arg count */ + if(argc != 3) { + fprintf(stderr, "Usage: %s device lxboot\n", argv[0]); + exit(0); + } + + /* First, open the device and make sure it's accessible */ + dev = open(argv[1], O_RDWR); + if(dev < 0) { + perror(argv[1]); + exit(0); + } + + /* Now open the lxboot and make sure it's reasonable */ + fd = open(argv[2], O_RDONLY); + if(fd < 0) { + perror(argv[2]); + close(dev); + exit(0); + } + + /* Read in the lxboot */ + nread = read(fd, &bootloader_image, sizeof(bootblock)); + if(nread != sizeof(bootblock)) { + perror("lxboot read"); + fprintf(stderr, "expected %d, got %d\n", sizeof(bootblock), nread); + exit(0); + } + + /* Read in the bootblock from disk. */ + nread = read(dev, &bootblock_from_disk, sizeof(bootblock)); + if(nread != sizeof(bootblock)) { + perror("bootblock read"); + fprintf(stderr, "expected %d, got %d\n", sizeof(bootblock), nread); + exit(0); + } + + /* Swap the bootblock's disklabel into the bootloader */ + bootloader_image.bootblock_label = bootblock_from_disk.bootblock_label; + + /* Calculate the bootblock checksum */ + bootloader_image.bootblock_checksum = 0; + for(i = 0; i < 63; i++) { + bootloader_image.bootblock_checksum += + bootloader_image.bootblock_quadwords[i]; + } + + /* Write the whole thing out! */ + lseek(dev, 0L, SEEK_SET); + if(write(dev, &bootloader_image, sizeof(bootblock)) != sizeof(bootblock)) { + perror("bootblock write"); + exit(0); + } + + close(fd); + close(dev); + exit(0); +} + + diff -u --recursive --new-file linux-1.3.74-orig/arch/alpha/config.in linux/arch/alpha/config.in --- linux-1.3.74-orig/arch/alpha/config.in Fri Mar 15 06:58:39 1996 +++ linux/arch/alpha/config.in Thu Mar 14 09:19:05 1996 @@ -56,8 +56,14 @@ define_bool CONFIG_ALPHA_EV5 y define_bool CONFIG_ALPHA_ALCOR y fi -# This needs to be defined for all EV4 and EV45 CPUs: + +if [ "$CONFIG_ALPHA_JENSEN" = "y" ] +then + bool 'Using SRM as bootloader' CONFIG_ALPHA_SRM y +fi + define_bool CONFIG_ALPHA_NEED_ROUNDING_EMULATION y + bool 'Echo console messages on /dev/ttyS1' CONFIG_SERIAL_ECHO if [ "$CONFIG_PCI" = "y" ]; then bool 'TGA Console Support' CONFIG_TGA_CONSOLE diff -u --recursive --new-file linux-1.3.74-orig/arch/alpha/kernel/irq.c linux/arch/alpha/kernel/irq.c --- linux-1.3.74-orig/arch/alpha/kernel/irq.c Fri Mar 15 06:59:40 1996 +++ linux/arch/alpha/kernel/irq.c Fri Mar 15 05:58:33 1996 @@ -281,7 +281,7 @@ #endif } -static inline void handle_irq(int irq, void *dev_id, struct pt_regs * regs) +static inline void handle_irq(int irq, struct pt_regs * regs) { struct irqaction * action = irq_action[irq]; @@ -340,6 +340,8 @@ unmask_irq(ack); } +#ifdef CONFIG_PCI + /* * Handle ISA interrupt via the PICs. */ @@ -469,6 +471,8 @@ } restore_flags(flags); } + +#endif /* CONFIG_PCI */ /* * Jensen is special: the vector is 0x8X0 for EISA interrupt X, and diff -u --recursive --new-file linux-1.3.74-orig/arch/alpha/kernel/setup.c linux/arch/alpha/kernel/setup.c --- linux-1.3.74-orig/arch/alpha/kernel/setup.c Fri Mar 15 06:58:39 1996 +++ linux/arch/alpha/kernel/setup.c Thu Mar 14 09:19:05 1996 @@ -128,8 +128,22 @@ ROOT_DEV = to_kdev_t(0x0802); /* sda2 */ command_line[COMMAND_LINE_SIZE - 1] = '\0'; - strcpy(command_line, COMMAND_LINE); - strcpy(saved_command_line, COMMAND_LINE); + + /* Hack for Jensen... since we're restricted to 8 or 16 + * chars for boot flags depending on the boot mode, + * we need some shorthand. This should do for + * installation. Later we'll add other abbreviaitions + * as well... + */ + if(strcmp(COMMAND_LINE, "INSTALL") == 0) { + strcpy(command_line, "root=/dev/fd0 load_ramdisk=1"); + strcpy(saved_command_line, command_line); + } + else { + strcpy(command_line, COMMAND_LINE); + strcpy(saved_command_line, COMMAND_LINE); + } + printk("Command line: %s\n", command_line); *cmdline_p = command_line; *memory_start_p = (unsigned long) &_end;