Save a byte from the mbr code (by using lret not ljmp).

This commit is contained in:
dsl 2007-04-10 16:54:34 +00:00
parent e38a76cc13
commit 74df11d186
1 changed files with 8 additions and 6 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: mbr.S,v 1.13 2005/12/11 12:17:49 christos Exp $ */
/* $NetBSD: mbr.S,v 1.14 2007/04/10 16:54:34 dsl Exp $ */
/*
* Copyright (c) 1999-2004 The NetBSD Foundation, Inc.
@ -108,15 +108,17 @@ ENTRY(start)
movw $BOOTADDR, %sp
mov %ax, %es
mov %ax, %ds
mov %sp, %si
movw $start, %di
movw $(bss_start - start)/2, %cx
movw $mbr, %di
mov $mbr - LOADADDR + BOOTADDR, %si
push %ax
push %di
movw $(bss_start - mbr), %cx
rep
movsw /* relocate code */
movsb /* relocate code */
mov $(bss_end - bss_start + 1)/2, %cx
rep
stosw /* zero bss */
ljmp $0, $mbr /* leap into copy of code */
lret /* Ensure %cs == 0 */
/*
* Sanity check the drive number passed by the BIOS. Some BIOSs may not