Subject: questions about various .S files in i386/boot
To: None <port-i386@NetBSD.ORG>
From: Perry E. Metzger <perry@piermont.com>
List: port-i386
Date: 03/20/1996 16:50:39
I've been scampering around some more in i386/boot of late, and I
discovered that there are lots of things in there that I simply do not
understand at all.

For instance, take the enclosed snippet of code, from start.S. All
through the code, we find these data32 macros. Could someone please
explain to me what they mean and why they are there? I feel sort of
stupid, but I just "don't get it" I suppose. Does it have something to
do with 16 bit vs. 32 bit *86 code?

Perry

[...]
#define	addr32	.byte 0x67
#define	data32	.byte 0x66
[...]
	.text	
	.globl	start

ENTRY(boot1)
start:
	# start (aka boot1) is loaded at 0x0:0x7c00 but we want 0x7c0:0
	# ljmp to the next instruction to adjust %cs
	data32
	ljmp $0x7c0, $start1

start1:
	# set up %ds
	movl	%cs, %ax
	movl	%ax, %ds

	# set up %ss and %esp
	data32
	movl	$BOOTSEG, %eax
	movl	%ax, %ss
	data32
	movl	$BOOTSTACK, %esp