Date: Mon, 3 May 2004 07:53:38 -0700 (PDT) From: Warner Losh <imp@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 52139 for review Message-ID: <200405031453.i43ErcwF036219@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=52139 Change 52139 by imp@imp_pacopaco on 2004/05/03 07:53:26 IFC @52136 Affected files ... .. //depot/projects/power/sys/alpha/conf/GENERIC#6 integrate .. //depot/projects/power/sys/amd64/conf/GENERIC#6 integrate .. //depot/projects/power/sys/boot/i386/boot0/Makefile#6 integrate .. //depot/projects/power/sys/boot/i386/boot0/boot0.S#1 branch .. //depot/projects/power/sys/boot/i386/boot0/boot0.s#5 delete .. //depot/projects/power/sys/boot/i386/boot0/boot0ext.S#1 branch .. //depot/projects/power/sys/boot/i386/boot0/boot0ext.s#3 delete .. //depot/projects/power/sys/boot/i386/boot0/boot0sio.s#4 delete .. //depot/projects/power/sys/boot/i386/boot0ext/Makefile#2 integrate .. //depot/projects/power/sys/boot/i386/boot0sio/Makefile#3 integrate .. //depot/projects/power/sys/boot/i386/boot2/boot1.S#2 integrate .. //depot/projects/power/sys/boot/i386/boot2/sio.S#2 integrate .. //depot/projects/power/sys/boot/i386/btx/btx/Makefile#4 integrate .. //depot/projects/power/sys/boot/i386/btx/btx/btx.S#2 integrate .. //depot/projects/power/sys/boot/i386/btx/btxldr/Makefile#4 integrate .. //depot/projects/power/sys/boot/i386/btx/btxldr/btxldr.S#2 integrate .. //depot/projects/power/sys/boot/i386/cdboot/Makefile#4 integrate .. //depot/projects/power/sys/boot/i386/libi386/amd64_tramp.S#2 integrate .. //depot/projects/power/sys/boot/i386/mbr/Makefile#4 integrate .. //depot/projects/power/sys/boot/i386/pxeldr/Makefile#4 integrate .. //depot/projects/power/sys/boot/i386/pxeldr/pxeldr.S#2 integrate .. //depot/projects/power/sys/boot/pc98/boot2/serial_16550.S#2 integrate .. //depot/projects/power/sys/boot/pc98/boot2/serial_8251.S#2 integrate .. //depot/projects/power/sys/boot/pc98/btx/btx/Makefile#3 integrate .. //depot/projects/power/sys/boot/pc98/btx/btx/btx.S#2 integrate .. //depot/projects/power/sys/boot/pc98/btx/btxldr/Makefile#3 integrate .. //depot/projects/power/sys/boot/pc98/btx/btxldr/btxldr.S#2 integrate .. //depot/projects/power/sys/cam/scsi/scsi_da.c#7 integrate .. //depot/projects/power/sys/compat/ndis/subr_ntoskrnl.c#7 integrate .. //depot/projects/power/sys/conf/NOTES#16 integrate .. //depot/projects/power/sys/conf/files#13 integrate .. //depot/projects/power/sys/conf/files.i386#10 integrate .. //depot/projects/power/sys/conf/files.sparc64#4 integrate .. //depot/projects/power/sys/conf/majors#9 integrate .. //depot/projects/power/sys/conf/options#16 integrate .. //depot/projects/power/sys/conf/options.sparc64#2 integrate .. //depot/projects/power/sys/contrib/pf/net/pf.c#4 integrate .. //depot/projects/power/sys/contrib/pf/net/pf_ioctl.c#2 integrate .. //depot/projects/power/sys/contrib/pf/net/pf_norm.c#2 integrate .. //depot/projects/power/sys/dev/asr/asr.c#5 integrate .. //depot/projects/power/sys/dev/ata/ata-all.c#8 integrate .. //depot/projects/power/sys/dev/ata/ata-all.h#8 integrate .. //depot/projects/power/sys/dev/ata/ata-commands.h#2 integrate .. //depot/projects/power/sys/dev/ata/ata-disk.h#3 integrate .. //depot/projects/power/sys/dev/ata/ata-isa.c#6 integrate .. //depot/projects/power/sys/dev/ata/ata-lowlevel.c#10 integrate .. //depot/projects/power/sys/dev/ata/ata-pci.c#11 integrate .. //depot/projects/power/sys/dev/ata/ata-pci.h#8 integrate .. //depot/projects/power/sys/dev/ata/ata-queue.c#7 integrate .. //depot/projects/power/sys/dev/ata/atapi-cd.h#4 integrate .. //depot/projects/power/sys/dev/ata/atapi-fd.h#3 integrate .. //depot/projects/power/sys/dev/ata/atapi-tape.h#2 integrate .. //depot/projects/power/sys/dev/cy/cy.c#2 integrate .. //depot/projects/power/sys/dev/cy/cy_isa.c#2 integrate .. //depot/projects/power/sys/dev/cy/cy_pci.c#2 integrate .. //depot/projects/power/sys/dev/cy/cyvar.h#1 branch .. //depot/projects/power/sys/dev/if_ndis/if_ndis.c#10 integrate .. //depot/projects/power/sys/dev/led/led.c#6 integrate .. //depot/projects/power/sys/dev/mii/brgphy.c#4 integrate .. //depot/projects/power/sys/dev/mii/dcphy.c#2 integrate .. //depot/projects/power/sys/dev/mii/e1000phy.c#3 integrate .. //depot/projects/power/sys/dev/mii/mii.c#2 integrate .. //depot/projects/power/sys/dev/mii/mii_physubr.c#2 integrate .. //depot/projects/power/sys/dev/mii/mlphy.c#2 integrate .. //depot/projects/power/sys/dev/mii/rgephy.c#2 integrate .. //depot/projects/power/sys/dev/mii/ruephy.c#2 integrate .. //depot/projects/power/sys/dev/mii/tlphy.c#2 integrate .. //depot/projects/power/sys/dev/mii/xmphy.c#2 integrate .. //depot/projects/power/sys/dev/pci/pci.c#16 integrate .. //depot/projects/power/sys/dev/sio/sio.c#9 integrate .. //depot/projects/power/sys/dev/sio/sio_ebus.c#3 delete .. //depot/projects/power/sys/dev/sound/pcm/buffer.c#4 integrate .. //depot/projects/power/sys/dev/usb/usbdevs#11 integrate .. //depot/projects/power/sys/dev/usb/usbdevs.h#11 integrate .. //depot/projects/power/sys/dev/usb/usbdevs_data.h#11 integrate .. //depot/projects/power/sys/dev/usb/uvscom.c#4 integrate .. //depot/projects/power/sys/geom/gate/g_gate.c#1 branch .. //depot/projects/power/sys/geom/gate/g_gate.h#1 branch .. //depot/projects/power/sys/geom/geom_gpt.c#3 integrate .. //depot/projects/power/sys/i386/conf/GENERIC#10 integrate .. //depot/projects/power/sys/i386/conf/NOTES#13 integrate .. //depot/projects/power/sys/i386/include/mpapic.h#2 delete .. //depot/projects/power/sys/i386/isa/clock.c#5 integrate .. //depot/projects/power/sys/i386/isa/cy.c#7 delete .. //depot/projects/power/sys/i386/isa/cyreg.h#2 delete .. //depot/projects/power/sys/i386/isa/ic/cd1400.h#2 delete .. //depot/projects/power/sys/ia64/acpica/madt.c#3 integrate .. //depot/projects/power/sys/ia64/conf/GENERIC#4 integrate .. //depot/projects/power/sys/ia64/conf/SKI#2 integrate .. //depot/projects/power/sys/ia64/ia64/trap.c#7 integrate .. //depot/projects/power/sys/kern/kern_clock.c#6 integrate .. //depot/projects/power/sys/kern/kern_environment.c#2 integrate .. //depot/projects/power/sys/kern/kern_thread.c#7 integrate .. //depot/projects/power/sys/kern/link_elf_obj.c#1 branch .. //depot/projects/power/sys/kern/subr_sleepqueue.c#2 integrate .. //depot/projects/power/sys/modules/geom/geom_gate/Makefile#1 branch .. //depot/projects/power/sys/modules/sio/Makefile#2 integrate .. //depot/projects/power/sys/net/if.h#6 integrate .. //depot/projects/power/sys/net/if_var.h#11 integrate .. //depot/projects/power/sys/net/if_vlan.c#6 integrate .. //depot/projects/power/sys/netgraph/ng_parse.c#4 integrate .. //depot/projects/power/sys/netinet/ip_fastfwd.c#4 integrate .. //depot/projects/power/sys/netinet/ip_input.c#8 integrate .. //depot/projects/power/sys/netinet/ip_output.c#8 integrate .. //depot/projects/power/sys/netinet/ip_var.h#6 integrate .. //depot/projects/power/sys/netinet/tcp_input.c#12 integrate .. //depot/projects/power/sys/netipsec/key.c#5 integrate .. //depot/projects/power/sys/pc98/conf/GENERIC#5 integrate .. //depot/projects/power/sys/pc98/pc98/sio.c#7 integrate .. //depot/projects/power/sys/pci/cy_pci.c#5 delete .. //depot/projects/power/sys/powerpc/conf/GENERIC#3 integrate .. //depot/projects/power/sys/sparc64/conf/GENERIC#4 integrate .. //depot/projects/power/sys/sparc64/conf/NOTES#2 integrate .. //depot/projects/power/sys/sparc64/ebus/ebus.c#3 integrate .. //depot/projects/power/sys/sparc64/include/nexusvar.h#2 integrate .. //depot/projects/power/sys/sparc64/isa/ofw_isa.c#2 integrate .. //depot/projects/power/sys/sparc64/isa/ofw_isa.h#2 integrate .. //depot/projects/power/sys/sparc64/sparc64/identcpu.c#2 integrate .. //depot/projects/power/sys/sparc64/sparc64/nexus.c#2 integrate .. //depot/projects/power/sys/sparc64/sparc64/ofw_machdep.c#5 integrate .. //depot/projects/power/sys/sys/mbuf.h#11 integrate .. //depot/projects/power/sys/sys/proc.h#11 integrate .. //depot/projects/power/sys/ufs/ffs/ffs_vfsops.c#8 integrate Differences ... ==== //depot/projects/power/sys/alpha/conf/GENERIC#6 (text+ko) ==== @@ -18,7 +18,7 @@ # # For hardware specific information check HARDWARE.TXT # -# $FreeBSD: src/sys/alpha/conf/GENERIC,v 1.168 2004/01/24 21:45:25 jeff Exp $ +# $FreeBSD: src/sys/alpha/conf/GENERIC,v 1.170 2004/05/02 20:40:17 marcel Exp $ machine alpha cpu EV4 @@ -60,6 +60,7 @@ options CD9660 #ISO 9660 Filesystem options PROCFS #Process filesystem (requires PSEUDOFS) options PSEUDOFS #Pseudo-filesystem framework +options GEOM_GPT #GUID Partition Tables. options COMPAT_43 #Compatible with BSD 4.3 [KEEP THIS!] options COMPAT_FREEBSD4 #Compatible with FreeBSD4 options SCSI_DELAY=15000 #Delay (in ms) before probing SCSI @@ -194,10 +195,10 @@ device umass # Disks/Mass storage - Requires scbus and da0 device ums # Mouse # USB Ethernet -device aue # ADMtek USB ethernet -device axe # ASIX Electronics USB ethernet -device cue # CATC USB ethernet -device kue # Kawasaki LSI USB ethernet +device aue # ADMtek USB Ethernet +device axe # ASIX Electronics USB Ethernet +device cue # CATC USB Ethernet +device kue # Kawasaki LSI USB Ethernet # FireWire support device firewire # FireWire bus code ==== //depot/projects/power/sys/amd64/conf/GENERIC#6 (text+ko) ==== @@ -16,7 +16,7 @@ # If you are in doubt as to the purpose or necessity of a line, check first # in NOTES. # -# $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.405 2004/03/25 03:19:28 obrien Exp $ +# $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.407 2004/05/02 20:40:18 marcel Exp $ machine amd64 cpu HAMMER @@ -44,6 +44,7 @@ options CD9660 # ISO 9660 Filesystem options PROCFS # Process filesystem (requires PSEUDOFS) options PSEUDOFS # Pseudo-filesystem framework +options GEOM_GPT # GUID Partition Tables. options IA32 # Compatible with i386 binaries options COMPAT_FREEBSD4 # Compatible with FreeBSD4 options SCSI_DELAY=15000 # Delay (in ms) before probing SCSI @@ -180,7 +181,7 @@ # PCI Ethernet NICs that use the common MII bus controller code. # NOTE: Be sure to keep the 'device miibus' line in order to use these NICs! device miibus # MII bus support -device bfe # Broadcom BCM440x 10/100 ethernet +device bfe # Broadcom BCM440x 10/100 Ethernet device bge # Broadcom BCM570xx Gigabit Ethernet device dc # DEC/Intel 21143 and various workalikes device fxp # Intel EtherExpress PRO/100B (82557, 82558) @@ -189,9 +190,9 @@ device rl # RealTek 8129/8139 device sf # Adaptec AIC-6915 (``Starfire'') device sis # Silicon Integrated Systems SiS 900/SiS 7016 -device sk # SysKonnect SK-984x & SK-982x gigabit ethernet +device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet device ste # Sundance ST201 (D-Link DFE-550TX) -device ti # Alteon Networks Tigon I/II gigabit ethernet +device ti # Alteon Networks Tigon I/II gigabit Ethernet device tl # Texas Instruments ThunderLAN device tx # SMC EtherPower II (83c170 ``EPIC'') device vr # VIA Rhine, Rhine II @@ -210,8 +211,8 @@ #device ie # EtherExpress 8/16, 3C507, StarLAN 10 etc. # XXX kvtop brokenness, pointer/int warnings #device lnc # NE2100, NE32-VL Lance Ethernet cards -device sn # SMC's 9000 series of ethernet chips -device xe # Xircom pccard ethernet +device sn # SMC's 9000 series of Ethernet chips +device xe # Xircom pccard Ethernet # ISA devices that use the old ISA shims #device le @@ -253,10 +254,10 @@ device urio # Diamond Rio 500 MP3 player device uscanner # Scanners # USB Ethernet, requires mii -device aue # ADMtek USB ethernet -device axe # ASIX Electronics USB ethernet -device cue # CATC USB ethernet -device kue # Kawasaki LSI USB ethernet +device aue # ADMtek USB Ethernet +device axe # ASIX Electronics USB Ethernet +device cue # CATC USB Ethernet +device kue # Kawasaki LSI USB Ethernet # FireWire support device firewire # FireWire bus code ==== //depot/projects/power/sys/boot/i386/boot0/Makefile#6 (text+ko) ==== @@ -1,12 +1,10 @@ -# $FreeBSD: src/sys/boot/i386/boot0/Makefile,v 1.25 2004/04/25 20:36:43 obrien Exp $ +# $FreeBSD: src/sys/boot/i386/boot0/Makefile,v 1.29 2004/04/28 21:31:19 ru Exp $ -PROG= ${BOOT} -INTERNALPROG= -FILES= ${BOOT} +PROG?= boot0 +STRIP= +BINMODE=${NOBINMODE} NOMAN= -SRCS= ${BOOT}.s - -BOOT?= boot0 +SRCS= ${PROG}.S # The default set of flags compiled into boot0. This enables update (writing # the modified boot0 back to disk after running so that the selection made is @@ -29,9 +27,9 @@ # command line BOOT_BOOT0_COMCONSOLE_SPEED?= 0xE3 -AFLAGS+=--defsym FLAGS=${BOOT_BOOT0_FLAGS} \ - --defsym TICKS=${BOOT_BOOT0_TICKS} \ - --defsym COMSPEED=${BOOT_BOOT0_COMCONSOLE_SPEED} +CFLAGS+=-DFLAGS=${BOOT_BOOT0_FLAGS} \ + -DTICKS=${BOOT_BOOT0_TICKS} \ + -DCOMSPEED=${BOOT_BOOT0_COMCONSOLE_SPEED} LDFLAGS=-N -e start -Ttext ${BOOT_BOOT0_ORG} -Wl,-S,--oformat,binary ==== //depot/projects/power/sys/boot/i386/boot0ext/Makefile#2 (text+ko) ==== @@ -1,7 +1,7 @@ -# $FreeBSD: src/sys/boot/i386/boot0ext/Makefile,v 1.1 2004/03/26 18:46:31 obrien Exp $ +# $FreeBSD: src/sys/boot/i386/boot0ext/Makefile,v 1.2 2004/04/28 21:31:20 ru Exp $ .PATH: ${.CURDIR}/../boot0 -BOOT= boot0ext +PROG= boot0ext .include "${.CURDIR}/../boot0/Makefile" ==== //depot/projects/power/sys/boot/i386/boot0sio/Makefile#3 (text+ko) ==== @@ -1,7 +1,8 @@ -# $FreeBSD: src/sys/boot/i386/boot0sio/Makefile,v 1.2 2004/02/06 21:58:31 ru Exp $ +# $FreeBSD: src/sys/boot/i386/boot0sio/Makefile,v 1.4 2004/04/28 21:31:20 ru Exp $ .PATH: ${.CURDIR}/../boot0 -BOOT= boot0sio +PROGNAME= boot0sio +CFLAGS+= -DSIO .include "${.CURDIR}/../boot0/Makefile" ==== //depot/projects/power/sys/boot/i386/boot2/boot1.S#2 (text+ko) ==== @@ -1,21 +1,21 @@ -// -// Copyright (c) 1998 Robert Nordier -// All rights reserved. -// -// Redistribution and use in source and binary forms are freely -// permitted provided that the above copyright notice and this -// paragraph and the following disclaimer are duplicated in all -// such forms. -// -// This software is provided "AS IS" and without any express or -// implied warranties, including, without limitation, the implied -// warranties of merchantability and fitness for a particular -// purpose. -// +/* + * Copyright (c) 1998 Robert Nordier + * All rights reserved. + * + * Redistribution and use in source and binary forms are freely + * permitted provided that the above copyright notice and this + * paragraph and the following disclaimer are duplicated in all + * such forms. + * + * This software is provided "AS IS" and without any express or + * implied warranties, including, without limitation, the implied + * warranties of merchantability and fitness for a particular + * purpose. + * + * $FreeBSD: src/sys/boot/i386/boot2/boot1.S,v 1.26 2004/04/28 14:31:43 ru Exp $ + */ -// $FreeBSD: src/sys/boot/i386/boot2/boot1.S,v 1.24 2004/02/17 07:13:04 ru Exp $ - -// Memory Locations +/* Memory Locations */ .set MEM_REL,0x700 // Relocation address .set MEM_ARG,0x900 // Arguments .set MEM_ORG,0x7c00 // Origin @@ -25,15 +25,15 @@ .set MEM_USR,0xa000 // Client start .set BDA_BOOT,0x472 // Boot howto flag -// Partition Constants +/* Partition Constants */ .set PRT_OFF,0x1be // Partition offset .set PRT_NUM,0x4 // Partitions .set PRT_BSD,0xa5 // Partition type -// Flag Bits +/* Flag Bits */ .set FL_PACKET,0x80 // Packet mode -// Misc. Constants +/* Misc. Constants */ .set SIZ_PAG,0x1000 // Page size .set SIZ_SEC,0x200 // Sector size @@ -44,19 +44,20 @@ start: jmp main // Start recognizably -// This is the start of a standard BIOS Parameter Block (BPB). Most bootable -// FAT disks have this at the start of their MBR. While normal BIOS's will -// work fine without this section, IBM's El Torito emulation "fixes" up the -// BPB by writing into the memory copy of the MBR. Rather than have data -// written into our xread routine, we'll define a BPB to work around it. -// The data marked with (T) indicates a field required for a ThinkPad to -// recognize the disk and (W) indicates fields written from IBM BIOS code. -// The use of the BPB is based on what OpenBSD and NetBSD implemented in -// their boot code but the required fields were determined by trial and error. -// -// Note: If additional space is needed in boot1, one solution would be to -// move the "prompt" message data (below) to replace the OEM ID. - +/* + * This is the start of a standard BIOS Parameter Block (BPB). Most bootable + * FAT disks have this at the start of their MBR. While normal BIOS's will + * work fine without this section, IBM's El Torito emulation "fixes" up the + * BPB by writing into the memory copy of the MBR. Rather than have data + * written into our xread routine, we'll define a BPB to work around it. + * The data marked with (T) indicates a field required for a ThinkPad to + * recognize the disk and (W) indicates fields written from IBM BIOS code. + * The use of the BPB is based on what OpenBSD and NetBSD implemented in + * their boot code but the required fields were determined by trial and error. + * + * Note: If additional space is needed in boot1, one solution would be to + * move the "prompt" message data (below) to replace the OEM ID. + */ .org 0x03, 0x00 oemid: .space 0x08, 0x00 // OEM ID @@ -78,21 +79,21 @@ ebpb: .byte 0 // BIOS physical drive number (W) .org 0x25,0x90 -// -// Trampoline used by boot2 to call read to read data from the disk via -// the BIOS. Call with: -// -// %cx:%ax - long - LBA to read in -// %es:(%bx) - caddr_t - buffer to read data into -// %dl - byte - drive to read from -// %dh - byte - num sectors to read -// +/* + * Trampoline used by boot2 to call read to read data from the disk via + * the BIOS. Call with: + * + * %cx:%ax - long - LBA to read in + * %es:(%bx) - caddr_t - buffer to read data into + * %dl - byte - drive to read from + * %dh - byte - num sectors to read + */ xread: push %ss // Address pop %ds // data -// -// Setup an EDD disk packet and pass it to read -// +/* + * Setup an EDD disk packet and pass it to read + */ xread.1: // Starting pushl $0x0 // absolute push %cx // block @@ -107,37 +108,37 @@ callw read // Read from disk lea 0x10(%bp),%sp // Clear stack lret // To far caller -// -// Load the rest of boot2 and BTX up, copy the parts to the right locations, -// and start it all up. -// +/* + * Load the rest of boot2 and BTX up, copy the parts to the right locations, + * and start it all up. + */ -// -// Setup the segment registers to flat addressing (segment 0) and setup the -// stack to end just below the start of our code. -// +/* + * Setup the segment registers to flat addressing (segment 0) and setup the + * stack to end just below the start of our code. + */ main: cld // String ops inc xor %cx,%cx // Zero mov %cx,%es // Address mov %cx,%ds // data mov %cx,%ss // Set up mov $start,%sp // stack -// -// Relocate ourself to MEM_REL. Since %cx == 0, the inc %ch sets -// %cx == 0x100. -// +/* + * Relocate ourself to MEM_REL. Since %cx == 0, the inc %ch sets + * %cx == 0x100. + */ mov %sp,%si // Source mov $MEM_REL,%di // Destination incb %ch // Word count rep // Copy movsw // code -// -// If we are on a hard drive, then load the MBR and look for the first -// FreeBSD slice. We use the fake partition entry below that points to -// the MBR when we call nread. The first pass looks for the first active -// FreeBSD slice. The second pass looks for the first non-active FreeBSD -// slice if the first one fails. -// +/* + * If we are on a hard drive, then load the MBR and look for the first + * FreeBSD slice. We use the fake partition entry below that points to + * the MBR when we call nread. The first pass looks for the first active + * FreeBSD slice. The second pass looks for the first non-active FreeBSD + * slice if the first one fails. + */ mov $part4,%si // Partition cmpb $0x80,%dl // Hard drive? jb main.4 // No @@ -157,30 +158,30 @@ jb main.2 // Yes dec %cx // Do two jcxz main.1 // passes -// -// If we get here, we didn't find any FreeBSD slices at all, so print an -// error message and die. -// +/* + * If we get here, we didn't find any FreeBSD slices at all, so print an + * error message and die. + */ mov $msg_part,%si // Message jmp error // Error -// -// Floppies use partition 0 of drive 0. -// +/* + * Floppies use partition 0 of drive 0. + */ main.4: xor %dx,%dx // Partition:drive -// -// Ok, we have a slice and drive in %dx now, so use that to locate and load -// boot2. %si references the start of the slice we are looking for, so go -// ahead and load up the first 16 sectors (boot1 + boot2) from that. When -// we read it in, we conveniently use 0x8cec as our transfer buffer. Thus, -// boot1 ends up at 0x8cec, and boot2 starts at 0x8cec + 0x200 = 0x8eec. -// The first part of boot2 is the disklabel, which is 0x114 bytes long. -// The second part is BTX, which is thus loaded into 0x9000, which is where -// it also runs from. The boot2.bin binary starts right after the end of -// BTX, so we have to figure out where the start of it is and then move the -// binary to 0xc000. Normally, BTX clients start at MEM_USR, or 0xa000, but -// when we use btxld to create boot2, we use an entry point of 0x2000. That -// entry point is relative to MEM_USR; thus boot2.bin starts at 0xc000. -// +/* + * Ok, we have a slice and drive in %dx now, so use that to locate and load + * boot2. %si references the start of the slice we are looking for, so go + * ahead and load up the first 16 sectors (boot1 + boot2) from that. When + * we read it in, we conveniently use 0x8cec as our transfer buffer. Thus, + * boot1 ends up at 0x8cec, and boot2 starts at 0x8cec + 0x200 = 0x8eec. + * The first part of boot2 is the disklabel, which is 0x114 bytes long. + * The second part is BTX, which is thus loaded into 0x9000, which is where + * it also runs from. The boot2.bin binary starts right after the end of + * BTX, so we have to figure out where the start of it is and then move the + * binary to 0xc000. Normally, BTX clients start at MEM_USR, or 0xa000, but + * when we use btxld to create boot2, we use an entry point of 0x2000. That + * entry point is relative to MEM_USR; thus boot2.bin starts at 0xc000. + */ main.5: mov %dx,MEM_ARG // Save args movb $NSECT,%dh // Sector count callw nread // Read disk @@ -198,9 +199,9 @@ stosb // up to 0x10000 callw seta20 // Enable A20 jmp start+MEM_JMP-MEM_ORG // Start BTX -// -// Enable A20 so we can access memory above 1 meg. -// +/* + * Enable A20 so we can access memory above 1 meg. + */ seta20: cli // Disable interrupts seta20.1: inb $0x64,%al // Get status testb $0x2,%al // Busy? @@ -214,9 +215,9 @@ outb %al,$0x60 // A20 sti // Enable interrupts retw // To caller -// -// Trampoline used to call read from within boot1. -// +/* + * Trampoline used to call read from within boot1. + */ nread: mov $MEM_BUF,%bx // Transfer buffer mov 0x8(%si),%ax // Get mov 0xa(%si),%cx // LBA @@ -226,10 +227,10 @@ mov $msg_read,%si // Otherwise, set the error // message and fall through to // the error routine -// -// Print out the error message pointed to by %ds:(%si) followed -// by a prompt, wait for a keypress, and then reboot the machine. -// +/* + * Print out the error message pointed to by %ds:(%si) followed + * by a prompt, wait for a keypress, and then reboot the machine. + */ error: callw putstr // Display message mov $prompt,%si // Display callw putstr // prompt @@ -237,9 +238,9 @@ int $0x16 // keypress movw $0x1234, BDA_BOOT // Do a warm boot ljmp $0xffff,$0x0 // reboot the machine -// -// Display a null-terminated string using the BIOS output. -// +/* + * Display a null-terminated string using the BIOS output. + */ putstr.0: mov $0x7,%bx // Page:attribute movb $0xe,%ah // BIOS: Display int $0x10 // character @@ -247,24 +248,24 @@ testb %al,%al // End of string? jne putstr.0 // No -// -// Overused return code. ereturn is used to return an error from the -// read function. Since we assume putstr succeeds, we (ab)use the -// same code when we return from putstr. -// +/* + * Overused return code. ereturn is used to return an error from the + * read function. Since we assume putstr succeeds, we (ab)use the + * same code when we return from putstr. + */ ereturn: movb $0x1,%ah // Invalid stc // argument return: retw // To caller -// -// Reads sectors from the disk. If EDD is enabled, then check if it is -// installed and use it if it is. If it is not installed or not enabled, then -// fall back to using CHS. Since we use a LBA, if we are using CHS, we have to -// fetch the drive parameters from the BIOS and divide it out ourselves. -// Call with: -// -// %dl - byte - drive number -// stack - 10 bytes - EDD Packet -// +/* + * Reads sectors from the disk. If EDD is enabled, then check if it is + * installed and use it if it is. If it is not installed or not enabled, then + * fall back to using CHS. Since we use a LBA, if we are using CHS, we have to + * fetch the drive parameters from the BIOS and divide it out ourselves. + * Call with: + * + * %dl - byte - drive number + * stack - 10 bytes - EDD Packet + */ read: push %dx // Save movb $0x8,%ah // BIOS: Get drive int $0x13 // parameters @@ -343,7 +344,7 @@ int $0x13 // read retw // To caller -// Messages +/* Messages */ msg_read: .asciz "Read" msg_part: .asciz "Boot" @@ -354,7 +355,7 @@ .org PRT_OFF,0x90 -// Partition table +/* Partition table */ .fill 0x30,0x1,0x0 part4: .byte 0x80, 0x00, 0x01, 0x00 ==== //depot/projects/power/sys/boot/i386/boot2/sio.S#2 (text+ko) ==== @@ -1,23 +1,23 @@ -# -# Copyright (c) 1998 Robert Nordier -# All rights reserved. -# -# Redistribution and use in source and binary forms are freely -# permitted provided that the above copyright notice and this -# paragraph and the following disclaimer are duplicated in all -# such forms. -# -# This software is provided "AS IS" and without any express or -# implied warranties, including, without limitation, the implied -# warranties of merchantability and fitness for a particular -# purpose. -# +/* + * Copyright (c) 1998 Robert Nordier + * All rights reserved. + * + * Redistribution and use in source and binary forms are freely + * permitted provided that the above copyright notice and this + * paragraph and the following disclaimer are duplicated in all + * such forms. + * + * This software is provided "AS IS" and without any express or + * implied warranties, including, without limitation, the implied + * warranties of merchantability and fitness for a particular + * purpose. + * + * $FreeBSD: src/sys/boot/i386/boot2/sio.S,v 1.8 2004/04/28 14:31:43 ru Exp $ + */ -# $FreeBSD: src/sys/boot/i386/boot2/sio.S,v 1.6 2004/02/17 07:13:04 ru Exp $ - - .set SIO_PRT,SIOPRT # Base port - .set SIO_FMT,SIOFMT # 8N1 - .set SIO_DIV,(115200/SIOSPD) # 115200 / SPD + .set SIO_PRT,SIOPRT // Base port + .set SIO_FMT,SIOFMT // 8N1 + .set SIO_DIV,(115200/SIOSPD) // 115200 / SPD .globl sio_init .globl sio_flush @@ -25,56 +25,56 @@ .globl sio_getc .globl sio_ischar -# void sio_init(void) +/* void sio_init(void) */ -sio_init: movw $SIO_PRT+0x3,%dx # Data format reg - movb $SIO_FMT|0x80,%al # Set format - outb %al,(%dx) # and DLAB - pushl %edx # Save - subb $0x3,%dl # Divisor latch reg - movw $SIO_DIV,%ax # Set - outw %ax,(%dx) # BPS - popl %edx # Restore - movb $SIO_FMT,%al # Clear - outb %al,(%dx) # DLAB - incl %edx # Modem control reg - movb $0x3,%al # Set RTS, - outb %al,(%dx) # DTR - incl %edx # Line status reg +sio_init: movw $SIO_PRT+0x3,%dx // Data format reg + movb $SIO_FMT|0x80,%al // Set format + outb %al,(%dx) // and DLAB + pushl %edx // Save + subb $0x3,%dl // Divisor latch reg + movw $SIO_DIV,%ax // Set + outw %ax,(%dx) // BPS + popl %edx // Restore + movb $SIO_FMT,%al // Clear + outb %al,(%dx) // DLAB + incl %edx // Modem control reg + movb $0x3,%al // Set RTS, + outb %al,(%dx) // DTR + incl %edx // Line status reg -# void sio_flush(void) +/* void sio_flush(void) */ -sio_flush.0: call sio_getc.1 # Get character -sio_flush: call sio_ischar # Check for character - jnz sio_flush.0 # Till none - ret # To caller +sio_flush.0: call sio_getc.1 // Get character +sio_flush: call sio_ischar // Check for character + jnz sio_flush.0 // Till none + ret // To caller -# void sio_putc(int c) +/* void sio_putc(int c) */ -sio_putc: movw $SIO_PRT+0x5,%dx # Line status reg - xor %ecx,%ecx # Timeout - movb $0x40,%ch # counter -sio_putc.1: inb (%dx),%al # Transmitter - testb $0x20,%al # buffer empty? - loopz sio_putc.1 # No - jz sio_putc.2 # If timeout - movb 0x4(%esp,1),%al # Get character - subb $0x5,%dl # Transmitter hold reg - outb %al,(%dx) # Write character -sio_putc.2: ret $0x4 # To caller +sio_putc: movw $SIO_PRT+0x5,%dx // Line status reg + xor %ecx,%ecx // Timeout + movb $0x40,%ch // counter +sio_putc.1: inb (%dx),%al // Transmitter + testb $0x20,%al // buffer empty? + loopz sio_putc.1 // No + jz sio_putc.2 // If timeout + movb 0x4(%esp,1),%al // Get character + subb $0x5,%dl // Transmitter hold reg + outb %al,(%dx) // Write character +sio_putc.2: ret $0x4 // To caller -# int sio_getc(void) +/* int sio_getc(void) */ -sio_getc: call sio_ischar # Character available? - jz sio_getc # No -sio_getc.1: subb $0x5,%dl # Receiver buffer reg - inb (%dx),%al # Read character - ret # To caller +sio_getc: call sio_ischar // Character available? + jz sio_getc // No +sio_getc.1: subb $0x5,%dl // Receiver buffer reg + inb (%dx),%al // Read character + ret // To caller -# int sio_ischar(void) +/* int sio_ischar(void) */ -sio_ischar: movw $SIO_PRT+0x5,%dx # Line status register - xorl %eax,%eax # Zero - inb (%dx),%al # Received data - andb $0x1,%al # ready? - ret # To caller +sio_ischar: movw $SIO_PRT+0x5,%dx // Line status register + xorl %eax,%eax // Zero + inb (%dx),%al // Received data + andb $0x1,%al // ready? + ret // To caller ==== //depot/projects/power/sys/boot/i386/btx/btx/Makefile#4 (text+ko) ==== @@ -1,10 +1,9 @@ -# $FreeBSD: src/sys/boot/i386/btx/btx/Makefile,v 1.17 2004/04/25 20:36:43 obrien Exp $ +# $FreeBSD: src/sys/boot/i386/btx/btx/Makefile,v 1.18 2004/04/27 19:45:15 ru Exp $ PROG= btx INTERNALPROG= NOMAN= SRCS= btx.S -CLEANFILES= btx .if defined(PAGING) CFLAGS+=-DPAGING ==== //depot/projects/power/sys/boot/i386/btx/btx/btx.S#2 (text+ko) ==== @@ -1,1173 +1,1174 @@ -# -# Copyright (c) 1998 Robert Nordier -# All rights reserved. -# -# Redistribution and use in source and binary forms are freely -# permitted provided that the above copyright notice and this -# paragraph and the following disclaimer are duplicated in all -# such forms. -# -# This software is provided "AS IS" and without any express or -# implied warranties, including, without limitation, the implied -# warranties of merchantability and fitness for a particular -# purpose. -# +/* + * Copyright (c) 1998 Robert Nordier + * All rights reserved. + * + * Redistribution and use in source and binary forms are freely + * permitted provided that the above copyright notice and this + * paragraph and the following disclaimer are duplicated in all + * such forms. + * + * This software is provided "AS IS" and without any express or + * implied warranties, including, without limitation, the implied + * warranties of merchantability and fitness for a particular + * purpose. + * + * $FreeBSD: src/sys/boot/i386/btx/btx/btx.S,v 1.36 2004/04/28 14:31:43 ru Exp $ + */ -# $FreeBSD: src/sys/boot/i386/btx/btx/btx.S,v 1.34 2004/02/11 08:42:37 ru Exp $ - -# -# Memory layout. -# - .set MEM_BTX,0x1000 # Start of BTX memory - .set MEM_ESP0,0x1800 # Supervisor stack - .set MEM_BUF,0x1800 # Scratch buffer - .set MEM_ESP1,0x1e00 # Link stack - .set MEM_IDT,0x1e00 # IDT - .set MEM_TSS,0x1f98 # TSS - .set MEM_MAP,0x2000 # I/O bit map - .set MEM_DIR,0x4000 # Page directory - .set MEM_TBL,0x5000 # Page tables - .set MEM_ORG,0x9000 # BTX code - .set MEM_USR,0xa000 # Start of user memory -# -# Paging control. -# - .set PAG_SIZ,0x1000 # Page size - .set PAG_CNT,0x1000 # Pages to map -# -# Segment selectors. -# - .set SEL_SCODE,0x8 # Supervisor code - .set SEL_SDATA,0x10 # Supervisor data - .set SEL_RCODE,0x18 # Real mode code - .set SEL_RDATA,0x20 # Real mode data - .set SEL_UCODE,0x28|3 # User code - .set SEL_UDATA,0x30|3 # User data - .set SEL_TSS,0x38 # TSS -# -# Task state segment fields. -# - .set TSS_ESP0,0x4 # PL 0 ESP - .set TSS_SS0,0x8 # PL 0 SS - .set TSS_ESP1,0xc # PL 1 ESP - .set TSS_MAP,0x66 # I/O bit map base -# -# System calls. -# - .set SYS_EXIT,0x0 # Exit - .set SYS_EXEC,0x1 # Exec -# -# V86 constants. -# - .set V86_FLG,0x208eff # V86 flag mask - .set V86_STK,0x400 # V86 stack allowance -# -# Dump format control bytes. -# - .set DMP_X16,0x1 # Word - .set DMP_X32,0x2 # Long - .set DMP_MEM,0x4 # Memory - .set DMP_EOL,0x8 # End of line -# -# Screen defaults and assumptions. -# - .set SCR_MAT,0x7 # Mode/attribute - .set SCR_COL,0x50 # Columns per row - .set SCR_ROW,0x19 # Rows per screen -# -# BIOS Data Area locations. -# - .set BDA_MEM,0x413 # Free memory - .set BDA_KEYFLAGS,0x417 # Keyboard shift-state flags - .set BDA_SCR,0x449 # Video mode - .set BDA_POS,0x450 # Cursor position - .set BDA_BOOT,0x472 # Boot howto flag -# -# Derivations, for brevity. -# - .set _ESP0H,MEM_ESP0>>0x8 # Byte 1 of ESP0 - .set _ESP1H,MEM_ESP1>>0x8 # Byte 1 of ESP1 - .set _TSSIO,MEM_MAP-MEM_TSS # TSS I/O base - .set _TSSLM,MEM_DIR-MEM_TSS-1 # TSS limit - .set _IDTLM,MEM_TSS-MEM_IDT-1 # IDT limit -# -# Code segment. -# +/* + * Memory layout. + */ + .set MEM_BTX,0x1000 // Start of BTX memory + .set MEM_ESP0,0x1800 // Supervisor stack + .set MEM_BUF,0x1800 // Scratch buffer + .set MEM_ESP1,0x1e00 // Link stack + .set MEM_IDT,0x1e00 // IDT + .set MEM_TSS,0x1f98 // TSS + .set MEM_MAP,0x2000 // I/O bit map + .set MEM_DIR,0x4000 // Page directory + .set MEM_TBL,0x5000 // Page tables + .set MEM_ORG,0x9000 // BTX code + .set MEM_USR,0xa000 // Start of user memory +/* + * Paging control. + */ + .set PAG_SIZ,0x1000 // Page size + .set PAG_CNT,0x1000 // Pages to map +/* + * Segment selectors. + */ + .set SEL_SCODE,0x8 // Supervisor code + .set SEL_SDATA,0x10 // Supervisor data + .set SEL_RCODE,0x18 // Real mode code + .set SEL_RDATA,0x20 // Real mode data + .set SEL_UCODE,0x28|3 // User code + .set SEL_UDATA,0x30|3 // User data + .set SEL_TSS,0x38 // TSS +/* + * Task state segment fields. + */ + .set TSS_ESP0,0x4 // PL 0 ESP + .set TSS_SS0,0x8 // PL 0 SS + .set TSS_ESP1,0xc // PL 1 ESP + .set TSS_MAP,0x66 // I/O bit map base +/* + * System calls. + */ + .set SYS_EXIT,0x0 // Exit + .set SYS_EXEC,0x1 // Exec +/* + * V86 constants. + */ + .set V86_FLG,0x208eff // V86 flag mask + .set V86_STK,0x400 // V86 stack allowance +/* + * Dump format control bytes. + */ + .set DMP_X16,0x1 // Word + .set DMP_X32,0x2 // Long + .set DMP_MEM,0x4 // Memory + .set DMP_EOL,0x8 // End of line +/* + * Screen defaults and assumptions. + */ + .set SCR_MAT,0x7 // Mode/attribute + .set SCR_COL,0x50 // Columns per row + .set SCR_ROW,0x19 // Rows per screen +/* + * BIOS Data Area locations. + */ + .set BDA_MEM,0x413 // Free memory + .set BDA_KEYFLAGS,0x417 // Keyboard shift-state flags + .set BDA_SCR,0x449 // Video mode + .set BDA_POS,0x450 // Cursor position + .set BDA_BOOT,0x472 // Boot howto flag +/* + * Derivations, for brevity. + */ + .set _ESP0H,MEM_ESP0>>0x8 // Byte 1 of ESP0 + .set _ESP1H,MEM_ESP1>>0x8 // Byte 1 of ESP1 + .set _TSSIO,MEM_MAP-MEM_TSS // TSS I/O base + .set _TSSLM,MEM_DIR-MEM_TSS-1 // TSS limit + .set _IDTLM,MEM_TSS-MEM_IDT-1 // IDT limit +/* + * Code segment. + */ .globl start >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200405031453.i43ErcwF036219>