mirror of https://github.com/ipxe/ipxe.git
[int13con] Create log partition only when CONSOLE_INT13 is enabled
Reduce the size of the USB disk image in the common case that CONSOLE_INT13 is not enabled. Originally-implemented-by: Romain Guyard <romain.guyard@mujin.co.jp> Signed-off-by: Michael Brown <mcb30@ipxe.org>pull/107/head
parent
49319f1bc9
commit
efc1ae5aba
|
@ -1,5 +1,7 @@
|
||||||
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
|
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
|
||||||
|
|
||||||
|
#include <config/console.h>
|
||||||
|
|
||||||
.text
|
.text
|
||||||
.arch i386
|
.arch i386
|
||||||
.section ".prefix", "awx", @progbits
|
.section ".prefix", "awx", @progbits
|
||||||
|
@ -13,10 +15,17 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
|
||||||
#define SECTORS 32
|
#define SECTORS 32
|
||||||
#define CYLADDR(cyl) ((((cyl) * HEADS + (((cyl) == 0) & 1)) * SECTORS) * 512)
|
#define CYLADDR(cyl) ((((cyl) * HEADS + (((cyl) == 0) & 1)) * SECTORS) * 512)
|
||||||
|
|
||||||
|
#ifdef CONSOLE_INT13
|
||||||
|
#define LOGPART 1
|
||||||
#define LOGSTART 0
|
#define LOGSTART 0
|
||||||
#define LOGCOUNT 1
|
#define LOGCOUNT 1
|
||||||
#define BOOTSTART 1
|
#define BOOTSTART 1
|
||||||
#define BOOTCOUNT 2
|
#define BOOTCOUNT 2
|
||||||
|
#else /* CONSOLE_INT13 */
|
||||||
|
#define LOGPART 0
|
||||||
|
#define BOOTSTART 0
|
||||||
|
#define BOOTCOUNT 2
|
||||||
|
#endif /* CONSOLE_INT13 */
|
||||||
|
|
||||||
/* Construct a C/H/S address */
|
/* Construct a C/H/S address */
|
||||||
.macro chs cylinder, head, sector
|
.macro chs cylinder, head, sector
|
||||||
|
@ -44,8 +53,14 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
|
||||||
.org 446
|
.org 446
|
||||||
.space 16
|
.space 16
|
||||||
.space 16
|
.space 16
|
||||||
|
|
||||||
/* Partition 3: log partition (for CONSOLE_INT13) */
|
/* Partition 3: log partition (for CONSOLE_INT13) */
|
||||||
|
.if LOGPART
|
||||||
partition 0x00, 0xe0, LOGSTART, LOGCOUNT
|
partition 0x00, 0xe0, LOGSTART, LOGCOUNT
|
||||||
|
.else
|
||||||
|
.space 16
|
||||||
|
.endif
|
||||||
|
|
||||||
/* Partition 4: boot partition */
|
/* Partition 4: boot partition */
|
||||||
partition 0x80, 0xeb, BOOTSTART, BOOTCOUNT
|
partition 0x80, 0xeb, BOOTSTART, BOOTCOUNT
|
||||||
|
|
||||||
|
@ -54,8 +69,10 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
|
||||||
.byte 0x55, 0xaa
|
.byte 0x55, 0xaa
|
||||||
|
|
||||||
/* Skip to start of log partition */
|
/* Skip to start of log partition */
|
||||||
|
.if LOGPART
|
||||||
.org CYLADDR(LOGSTART)
|
.org CYLADDR(LOGSTART)
|
||||||
.ascii "iPXE LOG\n\n"
|
.ascii "iPXE LOG\n\n"
|
||||||
|
.endif
|
||||||
|
|
||||||
/* Skip to start of boot partition */
|
/* Skip to start of boot partition */
|
||||||
.org CYLADDR(BOOTSTART)
|
.org CYLADDR(BOOTSTART)
|
||||||
|
|
Loading…
Reference in New Issue