View | Details | Raw Unified | Return to bug 148509
Collapse All | Expand All

(-)sys/boot/i386/boot2/boot1.S (-12 / +21 lines)
Lines 63-69 Link Here
63
63
64
		.org 0x0b, 0x00
64
		.org 0x0b, 0x00
65
bpb:		.word   512		# sector size (T)
65
bpb:		.word   512		# sector size (T)
66
		.byte	0		# sectors/clustor
66
		.byte	0		# sectors/cluster
67
		.word	0		# reserved sectors
67
		.word	0		# reserved sectors
68
		.byte	0		# number of FATs
68
		.byte	0		# number of FATs
69
		.word	0		# root entries
69
		.word	0		# root entries
Lines 171-186 Link Here
171
/*
171
/*
172
 * Ok, we have a slice and drive in %dx now, so use that to locate and load
172
 * Ok, we have a slice and drive in %dx now, so use that to locate and load
173
 * boot2.  %si references the start of the slice we are looking for, so go
173
 * boot2.  %si references the start of the slice we are looking for, so go
174
 * ahead and load up the first 16 sectors (boot1 + boot2) from that.  When
174
 * ahead and load up the first NSECT (16) sectors (boot1 + boot2) from that.
175
 * we read it in, we conveniently use 0x8c00 as our transfer buffer.  Thus,
175
 *
176
 * boot1 ends up at 0x8c00, and boot2 starts at 0x8c00 + 0x200 = 0x8e00.
176
 * When we read it in, we conveniently use MEM_BUF (0x8c00) as our transfer
177
 * buffer.  Thus, boot1 ends up at 0x8c00, and boot2 starts at 0x8c00 + 0x200
178
 * = 0x8e00.
179
 *
177
 * The first part of boot2 is the disklabel, which is 0x200 bytes long.
180
 * The first part of boot2 is the disklabel, which is 0x200 bytes long.
178
 * The second part is BTX, which is thus loaded into 0x9000, which is where
181
 * The second part is BTX, which is thus loaded into MEM_BTX (0x9000), which
179
 * it also runs from.  The boot2.bin binary starts right after the end of
182
 * is where it also runs from.  The boot2.bin binary starts right after the
180
 * BTX, so we have to figure out where the start of it is and then move the
183
 * end of BTX, so we have to figure out where the start of it is and then move
181
 * binary to 0xc000.  Normally, BTX clients start at MEM_USR, or 0xa000, but
184
 * the binary to 0xc000.  Normally, BTX clients start at MEM_USR, or 0xa000,
182
 * when we use btxld to create boot2, we use an entry point of 0x2000.  That
185
 * but when we use btxld to create boot2, we use an entry point of 0x2000.
183
 * entry point is relative to MEM_USR; thus boot2.bin starts at 0xc000.
186
 * That entry point is relative to MEM_USR; thus boot2.bin starts at 0xc000.
184
 */
187
 */
185
main.5: 	mov %dx,MEM_ARG			# Save args
188
main.5: 	mov %dx,MEM_ARG			# Save args
186
		movb $NSECT,%dh			# Sector count
189
		movb $NSECT,%dh			# Sector count
Lines 265-271 Link Here
265
 * fetch the drive parameters from the BIOS and divide it out ourselves.
268
 * fetch the drive parameters from the BIOS and divide it out ourselves.
266
 * Call with:
269
 * Call with:
267
 *
270
 *
268
 * %dl	- byte     - drive number
271
 * %dl   - byte     - drive number
269
 * stack - 10 bytes - EDD Packet
272
 * stack - 10 bytes - EDD Packet
270
 */
273
 */
271
read:		testb $FL_PACKET,%cs:MEM_REL+flags-start # LBA support enabled?
274
read:		testb $FL_PACKET,%cs:MEM_REL+flags-start # LBA support enabled?
Lines 359-366 Link Here
359
362
360
		.org PRT_OFF,0x90
363
		.org PRT_OFF,0x90
361
364
362
/* Partition table */
363
365
366
/*
367
 * Partition table
368
 *
369
 * This partition table is used when the boot code is installed onto a raw
370
 * disk rather than a slice of a disklabel.
371
 */
372
364
		.fill 0x30,0x1,0x0
373
		.fill 0x30,0x1,0x0
365
part4:		.byte 0x80, 0x00, 0x01, 0x00
374
part4:		.byte 0x80, 0x00, 0x01, 0x00
366
		.byte 0xa5, 0xfe, 0xff, 0xff
375
		.byte 0xa5, 0xfe, 0xff, 0xff
(-)sys/boot/i386/boot2/Makefile (+4 lines)
Lines 7-16 Link Here
7
# A value of 0x80 enables LBA support.
7
# A value of 0x80 enables LBA support.
8
BOOT_BOOT1_FLAGS?=	0x80
8
BOOT_BOOT1_FLAGS?=	0x80
9
9
10
# COM1, 9600 buad, 8N1, No Parity
10
BOOT_COMCONSOLE_PORT?= 0x3f8
11
BOOT_COMCONSOLE_PORT?= 0x3f8
11
BOOT_COMCONSOLE_SPEED?= 9600
12
BOOT_COMCONSOLE_SPEED?= 9600
12
B2SIOFMT?=	0x3
13
B2SIOFMT?=	0x3
13
14
15
# These hard coded values used by the linker match the values found in boot1.S
16
# REL1 is equivalent to MEM_REL which is where boot1.S will relocate itself.
17
# ORG1 is equivalent to MEM_ORG.
14
REL1=	0x700
18
REL1=	0x700
15
ORG1=	0x7c00
19
ORG1=	0x7c00
16
ORG2=	0x2000
20
ORG2=	0x2000

Return to bug 148509