From acfe34e6681556d6727d51dea8c63435b487bc79 Mon Sep 17 00:00:00 2001 From: dg Date: Wed, 28 Jun 1995 04:42:25 +0000 Subject: [PATCH] Make path to kernel absolute if it is passed in relative. This fixes a related bug in some of the new 'foo'boot bootstrap code that has been added over the past months. This change makes it no longer necessary for the bootstrap to fix up the path (i.e. it can be removed). --- sys/amd64/amd64/locore.S | 14 ++++++++++---- sys/amd64/amd64/locore.s | 14 ++++++++++---- sys/i386/i386/locore.s | 14 ++++++++++---- 3 files changed, 30 insertions(+), 12 deletions(-) diff --git a/sys/amd64/amd64/locore.S b/sys/amd64/amd64/locore.S index f088f4c4d551..caf982250e8e 100644 --- a/sys/amd64/amd64/locore.S +++ b/sys/amd64/amd64/locore.S @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)locore.s 7.3 (Berkeley) 5/13/91 - * $Id: locore.s,v 1.51 1995/03/11 03:49:46 phk Exp $ + * $Id: locore.s,v 1.52 1995/04/16 10:12:16 davidg Exp $ */ /* @@ -240,14 +240,20 @@ NON_GPROF_ENTRY(btext) */ movl BI_KERNELNAME(%ebx),%esi cmpl $0,%esi - je 1f /* No kernelname */ - lea _kernelname-KERNBASE,%edi + je 2f /* No kernelname */ movl $MAXPATHLEN,%ecx /* Brute force!!! */ + lea _kernelname-KERNBASE,%edi + cmpb $'/',(%esi) /* Make sure it starts with a slash */ + je 1f + movb $'/',(%edi) + incl %edi + decl %ecx +1: cld rep movsb -1: +2: /* * Determine the size of the boot loader's copy of the bootinfo * struct. This is impossible to do properly because old versions diff --git a/sys/amd64/amd64/locore.s b/sys/amd64/amd64/locore.s index f088f4c4d551..caf982250e8e 100644 --- a/sys/amd64/amd64/locore.s +++ b/sys/amd64/amd64/locore.s @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)locore.s 7.3 (Berkeley) 5/13/91 - * $Id: locore.s,v 1.51 1995/03/11 03:49:46 phk Exp $ + * $Id: locore.s,v 1.52 1995/04/16 10:12:16 davidg Exp $ */ /* @@ -240,14 +240,20 @@ NON_GPROF_ENTRY(btext) */ movl BI_KERNELNAME(%ebx),%esi cmpl $0,%esi - je 1f /* No kernelname */ - lea _kernelname-KERNBASE,%edi + je 2f /* No kernelname */ movl $MAXPATHLEN,%ecx /* Brute force!!! */ + lea _kernelname-KERNBASE,%edi + cmpb $'/',(%esi) /* Make sure it starts with a slash */ + je 1f + movb $'/',(%edi) + incl %edi + decl %ecx +1: cld rep movsb -1: +2: /* * Determine the size of the boot loader's copy of the bootinfo * struct. This is impossible to do properly because old versions diff --git a/sys/i386/i386/locore.s b/sys/i386/i386/locore.s index f088f4c4d551..caf982250e8e 100644 --- a/sys/i386/i386/locore.s +++ b/sys/i386/i386/locore.s @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)locore.s 7.3 (Berkeley) 5/13/91 - * $Id: locore.s,v 1.51 1995/03/11 03:49:46 phk Exp $ + * $Id: locore.s,v 1.52 1995/04/16 10:12:16 davidg Exp $ */ /* @@ -240,14 +240,20 @@ NON_GPROF_ENTRY(btext) */ movl BI_KERNELNAME(%ebx),%esi cmpl $0,%esi - je 1f /* No kernelname */ - lea _kernelname-KERNBASE,%edi + je 2f /* No kernelname */ movl $MAXPATHLEN,%ecx /* Brute force!!! */ + lea _kernelname-KERNBASE,%edi + cmpb $'/',(%esi) /* Make sure it starts with a slash */ + je 1f + movb $'/',(%edi) + incl %edi + decl %ecx +1: cld rep movsb -1: +2: /* * Determine the size of the boot loader's copy of the bootinfo * struct. This is impossible to do properly because old versions