[gPXE] early print message

Geert Stappers stappers at stappers.nl
Fri Apr 2 06:48:48 EDT 2010


Hello,

Over here I'm trying to USB boot gPXE.
On some computers I'm able to achieve that
and this E-mail is about computer model that says "no boot device".

To find the root cause of that problem,
have I the need for an early print routine.

So it is possible "to trace" execution of gPXE with print statements.
Like the 'kprintf()' in the Linux kernel.

Printing single characters do I with  INT 0x10.

Printing strings fails.

This is what I currently have:
diff --git a/src/arch/i386/prefix/mbr.S b/src/arch/i386/prefix/mbr.S
index adfe204..c1408f1 100644
--- a/src/arch/i386/prefix/mbr.S
+++ b/src/arch/i386/prefix/mbr.S
@@ -5,6 +5,7 @@
 	.org 0
 
 mbr:
+#include "earlyhello.S"
 	movw	$exec_sector, %bp
 	jmp	find_active_partition
 exec_sector:
diff --git a/src/arch/i386/prefix/earlyhello.S b/src/arch/i386/prefix/earlyhello.S
new file mode 100644
index 0000000..45424a5
--- /dev/null
+++ b/src/arch/i386/prefix/earlyhello.S
@@ -0,0 +1,32 @@
+FILE_LICENCE ( GPL2_OR_LATER )
+
+	.text
+	.arch i386
+	.section ".prefix", "awx", @progbits
+	.code16
+
+	/* Print message */
+	movb	$0x0e, %ah
+	movb	$'G', %al
+	int	$0x10
+	movb	$'o', %al
+	int	$0x10
+	movb	$'o', %al
+	int	$0x10
+	movb	$'d', %al
+	int	$0x10
+
+	movw	$text, %si
+	jmp	early_hello
+text:	.asciz	"morning\r\n"
+early_hello:
+	cld
+	movw	$0x0007, %bx
+	movb	$0x0e, %ah
+1:	lodsb
+	testb	%al, %al
+	je	99f
+	int	$0x10
+	jmp	1b
+99:
+/* last line */


It prints 'Good???', where '???' are non-ASCII characters
and 'Goodmorning
' is what is wanted.

What should I do to "early print strings"?


Cheers
Geert Stappers



More information about the gPXE mailing list