found 462157 3.60-1
thanks

On Tue, Jan 22, 2008 at 11:28:06PM +0100, Daniel Baumann wrote:
> Robert Millan wrote:
> > Please can you bring back default64 option so that lenny CDs can use it?
> 
> yep.
> 
> > Patch attached, based on the previous one.  Tested with
> > qemu/qemu-system-x86_64 and known to work.
> 
> did you also test it with 3.60?

Here, patch for 3.60 at the expense of dropping support for "pure" i386.

-- 
Robert Millan

<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call… if you are unable to speak?
(as seen on /.)
diff -ur syslinux-3.60.old/cpuinit.inc syslinux-3.60/cpuinit.inc
--- syslinux-3.60.old/cpuinit.inc	2008-01-11 07:42:10.000000000 +0100
+++ syslinux-3.60/cpuinit.inc	2008-01-23 00:19:29.000000000 +0100
@@ -48,30 +48,38 @@
 		rep movsd
 
 ;
-; Check if we're 386 (as opposed to 486+); if so we need to blank out
-; the WBINVD instruction
+; Determine if we're running on a 64-bit CPU
 ;
-; We check for 486 by setting EFLAGS.AC
+
+;
+; Check if this CPU supports the CPUID command
 ;
-%if DO_WBINVD
-		pushfd				; Save the good flags
+		pushfd				; Save the flags again
 		pushfd
 		pop eax
 		mov ebx,eax
-		xor eax,(1 << 18)		; AC bit
+		xor eax,(1 << 21)		; CPUID bit
 		push eax
 		popfd
 		pushfd
 		pop eax
 		popfd				; Restore the original flags
 		xor eax,ebx
-		jnz is_486
+		jz is_32bit
 ;
-; 386 - Looks like we better blot out the WBINVD instruction
+; Now check for the 64-bit flag (bit 29) in the CPU extended features byte ($8000_0001, edx)
 ;
-		mov byte [try_wbinvd],0c3h		; Near RET
-is_486:
-%endif	; DO_WBINVD
+		mov eax, 80000000h		; Find last AMD cpuid #
+		cpuid
+		cmp eax, 80000000h
+		jbe is_32bit
+		mov eax, 80000001h		; Read AMD CPU flags
+		cpuid
+		bt edx, 29			; 64-bit if bit 29 is set
+		jnc is_32bit
+
+is_64bit:	mov byte [Is64Bit],1		; Flag that we're 64-bit
+is_32bit:
 
 		section .data
 err_noram	db 'It appears your computer has less than '
diff -ur syslinux-3.60.old/keywords syslinux-3.60/keywords
--- syslinux-3.60.old/keywords	2008-01-11 07:42:10.000000000 +0100
+++ syslinux-3.60/keywords	2008-01-23 00:14:09.000000000 +0100
@@ -4,6 +4,7 @@
 append
 config
 default
+default64
 display
 font
 implicit
diff -ur syslinux-3.60.old/keywords.inc syslinux-3.60/keywords.inc
--- syslinux-3.60.old/keywords.inc	2008-01-11 07:42:10.000000000 +0100
+++ syslinux-3.60/keywords.inc	2008-01-23 00:14:09.000000000 +0100
@@ -50,6 +50,7 @@
 		keyword include,	pc_filecmd,	pc_include
 		keyword append,		pc_append
 		keyword default,	pc_default
+		keyword default64,	pc_default64
 		keyword display,	pc_filecmd,	get_msg_file
 		keyword font,		pc_filecmd,	loadfont
 		keyword implicit,	pc_setint16,	AllowImplicit
diff -ur syslinux-3.60.old/kwdhash.gen syslinux-3.60/kwdhash.gen
--- syslinux-3.60.old/kwdhash.gen	2008-01-11 07:42:15.000000000 +0100
+++ syslinux-3.60/kwdhash.gen	2008-01-23 00:14:09.000000000 +0100
@@ -4,6 +4,7 @@
 hash_append             equ 0xc53999a4
 hash_config             equ 0xc0c69547
 hash_default            equ 0xcc5159ed
+hash_default64          equ 0x4567b1c5
 hash_display            equ 0xd509bc40
 hash_font               equ 0x0032b1b4
 hash_implicit           equ 0xa6f50207
diff -ur syslinux-3.60.old/parseconfig.inc syslinux-3.60/parseconfig.inc
--- syslinux-3.60.old/parseconfig.inc	2008-01-11 07:42:11.000000000 +0100
+++ syslinux-3.60/parseconfig.inc	2008-01-23 00:14:09.000000000 +0100
@@ -20,7 +20,20 @@
 ;
 ; "default" command
 ;
-pc_default:	mov di,default_cmd
+pc_default:	cmp byte [HasDefault64],0	; Check if we accepted 'default64'
+		ja pc_getline			; If so, do nothing
+		mov di,default_cmd
+		call getline
+		mov byte [di-1],0		; null-terminate
+		ret
+
+;
+; "default64" command
+;
+pc_default64:	cmp byte [Is64Bit],0		; Make sure cpu is 64-bit
+		je pc_getline
+		mov byte [HasDefault64],1	; Note that we saw a default64
+		mov di,default_cmd
 		call getline
 		mov byte [di-1],0		; null-terminate
 		ret
@@ -431,6 +444,8 @@
 SerialPort	dw 0			; Serial port base (or 0 for no serial port)
 VKernelBytes	dw 0			; Number of bytes used by vkernels
 VKernel		db 0			; Have we seen any "label" statements?
+Is64Bit		db 0			; Is this CPU 64-bit?
+HasDefault64	db 0			; We've seen a 'default64' statement
 
 %if IS_PXELINUX
 IPAppend	db 0			; Default IPAPPEND option

Reply via email to