Procházet zdrojové kódy

[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>
master
Michael Brown před 4 roky
rodič
revize
efc1ae5aba
1 změnil soubory, kde provedl 17 přidání a 0 odebrání
  1. 17
    0
      src/arch/x86/prefix/usbdisk.S

+ 17
- 0
src/arch/x86/prefix/usbdisk.S Zobrazit soubor

@@ -1,5 +1,7 @@
1 1
 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
2 2
 
3
+#include <config/console.h>
4
+
3 5
 	.text
4 6
 	.arch i386
5 7
 	.section ".prefix", "awx", @progbits
@@ -13,10 +15,17 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
13 15
 #define SECTORS 32
14 16
 #define CYLADDR(cyl) ((((cyl) * HEADS + (((cyl) == 0) & 1)) * SECTORS) * 512)
15 17
 
18
+#ifdef CONSOLE_INT13
19
+#define LOGPART 1
16 20
 #define LOGSTART 0
17 21
 #define LOGCOUNT 1
18 22
 #define BOOTSTART 1
19 23
 #define BOOTCOUNT 2
24
+#else /* CONSOLE_INT13 */
25
+#define LOGPART 0
26
+#define BOOTSTART 0
27
+#define BOOTCOUNT 2
28
+#endif /* CONSOLE_INT13 */
20 29
 
21 30
 	/* Construct a C/H/S address */
22 31
 	.macro	chs cylinder, head, sector
@@ -44,8 +53,14 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
44 53
 	.org 446
45 54
 	.space 16
46 55
 	.space 16
56
+
47 57
 	/* Partition 3: log partition (for CONSOLE_INT13) */
58
+	.if LOGPART
48 59
 	partition 0x00, 0xe0, LOGSTART, LOGCOUNT
60
+	.else
61
+	.space 16
62
+	.endif
63
+
49 64
 	/* Partition 4: boot partition */
50 65
 	partition 0x80, 0xeb, BOOTSTART, BOOTCOUNT
51 66
 
@@ -54,8 +69,10 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
54 69
 	.byte 0x55, 0xaa
55 70
 
56 71
 /* Skip to start of log partition */
72
+	.if LOGPART
57 73
 	.org CYLADDR(LOGSTART)
58 74
 	.ascii "iPXE LOG\n\n"
75
+	.endif
59 76
 
60 77
 /* Skip to start of boot partition */
61 78
 	.org CYLADDR(BOOTSTART)

Načítá se…
Zrušit
Uložit