
From: Coywolf Qi Hunt <coywolf@greatcn.org>

Since "Direct booting from floppy is no longer supported", this patch is
remove the bootsect_helper code from x86_64 and PC-9800.


---

 25-akpm/arch/i386/boot98/setup.S |   87 ---------------------------------------
 25-akpm/arch/x86_64/boot/setup.S |   83 -------------------------------------
 2 files changed, 2 insertions(+), 168 deletions(-)

diff -puN arch/i386/boot98/setup.S~remove-bootsect_helper-on-x86_64-and-pc98 arch/i386/boot98/setup.S
--- 25/arch/i386/boot98/setup.S~remove-bootsect_helper-on-x86_64-and-pc98	2004-05-05 04:31:39.207454864 -0700
+++ 25-akpm/arch/i386/boot98/setup.S	2004-05-05 04:31:39.228451672 -0700
@@ -146,7 +146,7 @@ ramdisk_image:	.long	0		# address of loa
 ramdisk_size:	.long	0		# its size in bytes
 
 bootsect_kludge:
-		.word  bootsect_helper, SETUPSEG
+		.long	0		# obsolete
 
 heap_end_ptr:	.word	modelist+1024	# (Header version 0x0201 or later)
 					# space from here (exclusive) down to
@@ -691,91 +691,6 @@ default_switch:
 						# sequence
 	lret
 
-# This routine only gets called, if we get loaded by the simple
-# bootsect loader _and_ have a bzImage to load.
-# Because there is no place left in the 512 bytes of the boot sector,
-# we must emigrate to code space here.
-bootsect_helper:
-	cmpw	$0, %cs:bootsect_es
-	jnz	bootsect_second
-
-	movb	$0x20, %cs:type_of_loader
-	movw	%es, %ax
-	shrw	$4, %ax
-	movb	%ah, %cs:bootsect_src_base+2
-	movw	%es, %ax
-	movw	%ax, %cs:bootsect_es
-	subw	$SYSSEG, %ax
-	lret					# nothing else to do for now
-
-bootsect_second:
-	pushw	%bx
-	pushw	%cx
-	pushw	%si
-	pushw	%di
-	testw	%bp, %bp			# 64K full ?
-	jne	bootsect_ex
-
-	xorw	%cx, %cx			# zero means full 64K
-	pushw	%cs
-	popw	%es
-	movw	$bootsect_gdt, %bx
-	xorw	%si, %si			# source address
-	xorw	%di, %di			# destination address
-	movb	$0x90, %ah
-	int	$0x1f
-	jc	bootsect_panic			# this, if INT1F fails
-
-	movw	%cs:bootsect_es, %es		# we reset %es to always point
-	incb	%cs:bootsect_dst_base+2		# to 0x10000
-bootsect_ex:
-	movb	%cs:bootsect_dst_base+2, %ah
-	shlb	$4, %ah				# we now have the number of
-						# moved frames in %ax
-	xorb	%al, %al
-	popw	%di
-	popw	%si
-	popw	%cx
-	popw	%bx
-	lret
-
-bootsect_gdt:
-	.word	0, 0, 0, 0
-	.word	0, 0, 0, 0
-
-bootsect_src:
-	.word	0xffff
-
-bootsect_src_base:
-	.byte	0x00, 0x00, 0x01		# base = 0x010000
-	.byte	0x93				# typbyte
-	.word	0				# limit16,base24 =0
-
-bootsect_dst:
-	.word	0xffff
-
-bootsect_dst_base:
-	.byte	0x00, 0x00, 0x10		# base = 0x100000
-	.byte	0x93				# typbyte
-	.word	0				# limit16,base24 =0
-	.word	0, 0, 0, 0			# BIOS CS
-	.word	0, 0, 0, 0			# BIOS DS
-
-bootsect_es:
-	.word	0
-
-bootsect_panic:
-	pushw	%cs
-	popw	%ds
-	cld
-	leaw	bootsect_panic_mess, %si
-	call	prtstr
-
-bootsect_panic_loop:
-	jmp	bootsect_panic_loop
-
-bootsect_panic_mess:
-	.string	"INT1F refuses to access high mem, giving up."
 
 # This routine prints one character (in %al) on console.
 # PC-9800 doesn't have BIOS-function to do it like IBM PC's INT 10h - 0Eh,
diff -puN arch/x86_64/boot/setup.S~remove-bootsect_helper-on-x86_64-and-pc98 arch/x86_64/boot/setup.S
--- 25/arch/x86_64/boot/setup.S~remove-bootsect_helper-on-x86_64-and-pc98	2004-05-05 04:31:39.223452432 -0700
+++ 25-akpm/arch/x86_64/boot/setup.S	2004-05-05 04:31:39.227451824 -0700
@@ -132,7 +132,7 @@ ramdisk_image:	.long	0		# address of loa
 ramdisk_size:	.long	0		# its size in bytes
 
 bootsect_kludge:
-		.word  bootsect_helper, SETUPSEG
+		.long	0		# obsolete
 
 heap_end_ptr:	.word	modelist+1024	# (Header version 0x0201 or later)
 					# space from here (exclusive) down to
@@ -759,87 +759,6 @@ default_switch:
 	outb	%al, $0x70
 	lret
 
-# This routine only gets called, if we get loaded by the simple
-# bootsect loader _and_ have a bzImage to load.
-# Because there is no place left in the 512 bytes of the boot sector,
-# we must emigrate to code space here.
-bootsect_helper:
-	cmpw	$0, %cs:bootsect_es
-	jnz	bootsect_second
-
-	movb	$0x20, %cs:type_of_loader
-	movw	%es, %ax
-	shrw	$4, %ax
-	movb	%ah, %cs:bootsect_src_base+2
-	movw	%es, %ax
-	movw	%ax, %cs:bootsect_es
-	subw	$SYSSEG, %ax
-	lret					# nothing else to do for now
-
-bootsect_second:
-	pushw	%cx
-	pushw	%si
-	pushw	%bx
-	testw	%bx, %bx			# 64K full?
-	jne	bootsect_ex
-
-	movw	$0x8000, %cx			# full 64K, INT15 moves words
-	pushw	%cs
-	popw	%es
-	movw	$bootsect_gdt, %si
-	movw	$0x8700, %ax
-	int	$0x15
-	jc	bootsect_panic			# this, if INT15 fails
-
-	movw	%cs:bootsect_es, %es		# we reset %es to always point
-	incb	%cs:bootsect_dst_base+2		# to 0x10000
-bootsect_ex:
-	movb	%cs:bootsect_dst_base+2, %ah
-	shlb	$4, %ah				# we now have the number of
-						# moved frames in %ax
-	xorb	%al, %al
-	popw	%bx
-	popw	%si
-	popw	%cx
-	lret
-
-bootsect_gdt:
-	.word	0, 0, 0, 0
-	.word	0, 0, 0, 0
-
-bootsect_src:
-	.word	0xffff
-
-bootsect_src_base:
-	.byte	0x00, 0x00, 0x01		# base = 0x010000
-	.byte	0x93				# typbyte
-	.word	0				# limit16,base24 =0
-
-bootsect_dst:
-	.word	0xffff
-
-bootsect_dst_base:
-	.byte	0x00, 0x00, 0x10		# base = 0x100000
-	.byte	0x93				# typbyte
-	.word	0				# limit16,base24 =0
-	.word	0, 0, 0, 0			# BIOS CS
-	.word	0, 0, 0, 0			# BIOS DS
-
-bootsect_es:
-	.word	0
-
-bootsect_panic:
-	pushw	%cs
-	popw	%ds
-	cld
-	leaw	bootsect_panic_mess, %si
-	call	prtstr
-	
-bootsect_panic_loop:
-	jmp	bootsect_panic_loop
-
-bootsect_panic_mess:
-	.string	"INT15 refuses to access high mem, giving up."
 
 # This routine checks that the keyboard command queue is empty
 # (after emptying the output buffers)

_
