Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 Sep 2002 02:08:50 -0700 (PDT)
From:      Peter Wemm <peter@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 17845 for review
Message-ID:  <200209210908.g8L98oKT007114@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://people.freebsd.org/~peter/p4db/chv.cgi?CH=17845

Change 17845 by peter@peter_overcee on 2002/09/21 02:08:39

	more bootinfo/metadata tidyup

Affected files ...

.. //depot/projects/hammer/sys/x86_64/include/cpu.h#4 edit
.. //depot/projects/hammer/sys/x86_64/x86_64/autoconf.c#3 edit
.. //depot/projects/hammer/sys/x86_64/x86_64/genassym.c#6 edit
.. //depot/projects/hammer/sys/x86_64/x86_64/locore.s#11 edit
.. //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#16 edit

Differences ...

==== //depot/projects/hammer/sys/x86_64/include/cpu.h#4 (text+ko) ====

@@ -72,19 +72,9 @@
 #define CPU_CONSDEV		1	/* dev_t: console terminal device */
 #define	CPU_ADJKERNTZ		2	/* int:	timezone offset	(seconds) */
 #define	CPU_DISRTCSET		3	/* int: disable resettodr() call */
-#define CPU_BOOTINFO		4	/* struct: bootinfo */
 #define	CPU_WALLCLOCK		5	/* int:	indicates wall CMOS clock */
 #define	CPU_MAXID		6	/* number of valid machdep ids */
 
-#define CTL_MACHDEP_NAMES { \
-	{ 0, 0 }, \
-	{ "console_device", CTLTYPE_STRUCT }, \
-	{ "adjkerntz", CTLTYPE_INT }, \
-	{ "disable_rtc_set", CTLTYPE_INT }, \
-	{ "bootinfo", CTLTYPE_STRUCT }, \
-	{ "wall_cmos_clock", CTLTYPE_INT }, \
-}
-
 #ifdef _KERNEL
 extern char	btext[];
 extern char	etext[];

==== //depot/projects/hammer/sys/x86_64/x86_64/autoconf.c#3 (text+ko) ====

@@ -75,7 +75,6 @@
 #include <nfsclient/nfsdiskless.h>
 #endif
 
-#include <machine/bootinfo.h>
 #include <machine/md_var.h>
 #include <i386/isa/icu.h>
 
@@ -160,43 +159,8 @@
 configure_final(dummy)
 	void *dummy;
 {
-	int i;
 
 	cninit_finish(); 
-
-	if (bootverbose) {
-		/*
-		 * Print out the BIOS's idea of the disk geometries.
-		 */
-		printf("BIOS Geometries:\n");
-		for (i = 0; i < N_BIOS_GEOM; i++) {
-			unsigned long bios_geom;
-			int max_cylinder, max_head, max_sector;
-
-			bios_geom = bootinfo.bi_bios_geom[i];
-
-			/*
-			 * XXX the bootstrap punts a 1200K floppy geometry
-			 * when the get-disk-geometry interrupt fails.  Skip
-			 * drives that have this geometry.
-			 */
-			if (bios_geom == 0x4f010f)
-				continue;
-
-			printf(" %x:%08lx ", i, bios_geom);
-			max_cylinder = bios_geom >> 16;
-			max_head = (bios_geom >> 8) & 0xff;
-			max_sector = bios_geom & 0xff;
-			printf(
-		"0..%d=%d cylinders, 0..%d=%d heads, 1..%d=%d sectors\n",
-			       max_cylinder, max_cylinder + 1,
-			       max_head, max_head + 1,
-			       max_sector, max_sector);
-		}
-		printf(" %d accounted for\n", bootinfo.bi_n_bios_used);
-
-		printf("Device configuration finished.\n");
-	}
 	cold = 0;
 }
 

==== //depot/projects/hammer/sys/x86_64/x86_64/genassym.c#6 (text+ko) ====

@@ -52,7 +52,6 @@
 #include <sys/resourcevar.h>
 #include <sys/ucontext.h>
 #include <sys/user.h>
-#include <machine/bootinfo.h>
 #include <machine/tss.h>
 #include <sys/vmmeter.h>
 #include <vm/vm.h>
@@ -159,17 +158,7 @@
 ASSYM(EFAULT, EFAULT);
 ASSYM(ENAMETOOLONG, ENAMETOOLONG);
 ASSYM(MAXPATHLEN, MAXPATHLEN);
-ASSYM(BOOTINFO_SIZE, sizeof(struct bootinfo));
-ASSYM(BI_VERSION, offsetof(struct bootinfo, bi_version));
-ASSYM(BI_KERNELNAME, offsetof(struct bootinfo, bi_kernelname));
-ASSYM(BI_NFS_DISKLESS, offsetof(struct bootinfo, bi_nfs_diskless));
-ASSYM(BI_ENDCOMMON, offsetof(struct bootinfo, bi_endcommon));
-ASSYM(NFSDISKLESS_SIZE, sizeof(struct nfs_diskless));
-ASSYM(BI_SIZE, offsetof(struct bootinfo, bi_size));
-ASSYM(BI_SYMTAB, offsetof(struct bootinfo, bi_symtab));
-ASSYM(BI_ESYMTAB, offsetof(struct bootinfo, bi_esymtab));
-ASSYM(BI_KERNEND, offsetof(struct bootinfo, bi_kernend));
-ASSYM(PC_SIZEOF, sizeof(struct pcpu));
+eSSYM(PC_SIZEOF, sizeof(struct pcpu));
 ASSYM(PC_PRVSPACE, offsetof(struct pcpu, pc_prvspace));
 ASSYM(PC_CURTHREAD, offsetof(struct pcpu, pc_curthread));
 ASSYM(PC_INT_PENDING, offsetof(struct pcpu, pc_int_pending));

==== //depot/projects/hammer/sys/x86_64/x86_64/locore.s#11 (text+ko) ====

@@ -108,7 +108,7 @@
 HIDENAME(tmpstk):
 
 	.globl	modulep
-bootinfo:	.long	0		/* phys addr of module table */
+modulep:	.long	0		/* phys addr of metadata table */
 
 		.globl KERNend
 KERNend:	.long	0		/* phys addr end of kernel (just after bss) */
@@ -204,7 +204,7 @@
 	mov	%ax, %fs
 	mov	%ax, %gs
 
-	call	recover_bootinfo
+	call	recover_metadata
 
 	call	identify_cpu
 
@@ -275,10 +275,10 @@
 
 /**********************************************************************
  *
- * Recover the bootinfo passed to us from the boot program
+ * Recover the metadata passed to us from the boot program
  *
  */
-recover_bootinfo:
+recover_metadata:
 	/*
 	 * New uniform boot code:
 	 *	(*btext)(howto, bootdev, 0, 0, 0, &bootinfo, modulep, kernend)
@@ -292,7 +292,7 @@
 	movl	32(%ebp),%eax		/* modulep */
 	movl	%eax,R(modulep)
 	movl	36(%ebp),%eax		/* kernend */
-	movl	%eax,R(kernend)
+	movl	%eax,R(KERNend)
 
 	ret
 
@@ -329,12 +329,8 @@
 
 create_pagetables:
 
-/* We are told where the end of the kernel space is, believe it. */
-	movl	R(kernend),%esi
-	
-	addl	$PAGE_MASK,%esi
-	andl	$~PAGE_MASK,%esi
-	movl	%esi,R(KERNend)		/* save end of kernel */
+/* We are told where the end of the kernel space is. */
+	movl	R(KERNend),%esi		/* get end of kernel */
 	movl	%esi,R(physfree)	/* next free page is at end of kernel */
 
 /* Allocate Kernel Page Tables */

==== //depot/projects/hammer/sys/x86_64/x86_64/machdep.c#16 (text+ko) ====

@@ -97,7 +97,6 @@
 #include <machine/reg.h>
 #include <machine/clock.h>
 #include <machine/specialreg.h>
-#include <machine/bootinfo.h>
 #include <machine/md_var.h>
 #include <machine/pcb_ext.h>		/* pcb.h included via sys/user.h */
 #include <machine/proc.h>
@@ -626,16 +625,9 @@
 SYSCTL_INT(_machdep, CPU_DISRTCSET, disable_rtc_set,
 	CTLFLAG_RW, &disable_rtc_set, 0, "");
 
-SYSCTL_STRUCT(_machdep, CPU_BOOTINFO, bootinfo, 
-	CTLFLAG_RD, &bootinfo, bootinfo, "");
-
 SYSCTL_INT(_machdep, CPU_WALLCLOCK, wall_cmos_clock,
 	CTLFLAG_RW, &wall_cmos_clock, 0, "");
 
-u_long bootdev;		/* not a dev_t - encoding is different */
-SYSCTL_ULONG(_machdep, OID_AUTO, guessed_bootdev,
-	CTLFLAG_RD, &bootdev, 0, "Maybe the Boot device (not in dev_t format)");
-
 /*
  * Initialize 386 and configure to run kernel
  */
@@ -1131,8 +1123,8 @@
 	int first;
 {
 	struct gate_descriptor *gdp;
-	int gsel_tss, metadata_missing, off, x;
-	/* table descriptors - used to load tables by microp */
+	caddr_t kmdp;
+	int gsel_tss, off, x;
 	struct region_descriptor r_gdt, r_idt;
 	struct pcpu *pc;
 
@@ -1148,17 +1140,11 @@
 	 */
 	proc_linkup(&proc0, &ksegrp0, &kse0, &thread0);
 
-	metadata_missing = 0;
-	if (bootinfo.bi_modulep) {
-		preload_metadata = (caddr_t)bootinfo.bi_modulep + KERNBASE;
-		preload_bootstrap_relocate(KERNBASE);
-	} else {
-		metadata_missing = 1;
-	}
-	if (envmode == 1)
-		kern_envp = static_env;
-	else if (bootinfo.bi_envp)
-		kern_envp = (caddr_t)bootinfo.bi_envp + KERNBASE;
+	preload_metadata = (caddr_t)modulep + KERNBASE;
+	preload_bootstrap_relocate(KERNBASE);
+	kmdp = preload_search_by_type("elf kernel");
+	boothowto = MD_FETCH(kmdp, MODINFOMD_HOWTO, int);
+	kern_envp = MD_FETCH(kmdp, MODINFOMD_ENVP, char *);
 
 	/* Init basic tunables, hz etc */
 	init_param1();
@@ -1269,9 +1255,6 @@
 	 */
 	cninit();
 
-	if (metadata_missing)
-		printf("WARNING: loader(8) metadata is missing!\n");
-
 #ifdef DEV_ISA
 	isa_defaultirq();
 #endif

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe p4-projects" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200209210908.g8L98oKT007114>