Skip to contentSkip to conversation

Stack corruption problem with SeaBIOS/gPXE under QEMU

Qemu-devel Naphtali Sprei 6 participants 21 messages Nov 12, 2009 – Nov 29, 2009

lore
Share & tools
lore
#0 lore raw

Hi,
I've found a problem with the usage of SeaBIOS/gPXE in Qemu.
The scenario is when failing to boot from network and falling back to booting from hard-disk (-boot nc). The cause of the problem is that both SeaBIOS and gPXE (in it's installation phase) uses same stack area, 0x7c00. The gPXE code corrupts the SeaBIOS stack, so when gPXE returns to SeaBIOS chaos occurs.

Output: "qemu: fatal: Trying to execute code outside RAM or ROM at 0x00000000eb300000"

A simple hack/patch (attached) solves this problem, but a proper patch expected from the SeaBIOS guys.

Enjoy,

Naphtali

Patch against current SeaBIOS git

---
 src/arch/i386/prefix/pxeprefix.S |    2 +-
 src/arch/i386/prefix/romprefix.S |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
src/arch/i386/prefix/pxeprefix.S +1 -1
index b541e4b..11dd45d 100644
@@ -47,7 +47,7 @@ FILE_LICENCE ( GPL2_OR_LATER )
 	/* Set up stack just below 0x7c00 */
 	xorw	%ax, %ax
 	movw	%ax, %ss
-	movl	$0x7c00, %esp
+	movl	$0x7a00, %esp
 	/* Clear direction flag, for the sake of sanity */
 	cld
 	/* Print welcome message */
src/arch/i386/prefix/romprefix.S +1 -1
index cb474e8..93f3f17 100644
@@ -587,7 +587,7 @@ exec:	/* Set %ds = %cs */
 	/* Obtain a reasonably-sized temporary stack */
 	xorw	%ax, %ax
 	movw	%ax, %ss
-	movw	$0x7c00, %sp
+	movw	$0x7a00, %sp
 
 	/* Install gPXE */
 	movl	image_source, %esi
Signature · 1 line
1.6.3.3
#1 lore raw

Hi,

Quoted 8 lines · Naphtali Sprei

I've found a problem with the usage of SeaBIOS/gPXE in Qemu. The scenario is when failing to boot from network and falling back to booting from hard-disk (-boot nc). The cause of the problem is that both SeaBIOS and gPXE (in it's installation phase) uses same stack area, 0x7c00. The gPXE code corrupts the SeaBIOS stack, so when gPXE returns to SeaBIOS chaos occurs.

Output: "qemu: fatal: Trying to execute code outside RAM or ROM at 0x00000000eb300000"

Thanks for reporting this.

We can move the SeaBIOS stack, but it's not clear to me where to move it to. Bochs bios puts the top of the stack at 0x10000, but this could potentially conflict with the OS load to 0x7c00. So, in SeaBIOS the top of stack was moved to 0x7c00 to prevent this conflict.

Maybe the gPXE developers know where the bios typically places its stack.

However, I'm not sure why gPXE doesn't just use the stack it was given, or allocate the stack space it needs with PMM.

Quoted 8 lines

A simple hack/patch (attached) solves this problem, but a proper patch expected from the SeaBIOS guys.

Enjoy,

Naphtali

Patch against current SeaBIOS git

The patch isn't against SeaBIOS. Did you mean gPXE?

-Kevin

Quoted 38 lines
---
 src/arch/i386/prefix/pxeprefix.S |    2 +-
 src/arch/i386/prefix/romprefix.S |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
src/arch/i386/prefix/pxeprefix.S +1 -1
index b541e4b..11dd45d 100644
@@ -47,7 +47,7 @@ FILE_LICENCE ( GPL2_OR_LATER )
 	/* Set up stack just below 0x7c00 */
 	xorw	%ax, %ax
 	movw	%ax, %ss
-	movl	$0x7c00, %esp
+	movl	$0x7a00, %esp
 	/* Clear direction flag, for the sake of sanity */
 	cld
 	/* Print welcome message */
src/arch/i386/prefix/romprefix.S +1 -1
index cb474e8..93f3f17 100644
@@ -587,7 +587,7 @@ exec:	/* Set %ds = %cs */
 	/* Obtain a reasonably-sized temporary stack */
 	xorw	%ax, %ax
 	movw	%ax, %ss
-	movw	$0x7c00, %sp
+	movw	$0x7a00, %sp
 
 	/* Install gPXE */
 	movl	image_source, %esi
Signature · 1 line
1.6.3.3
#2 lore raw
Quoted 19 lines · Kevin O'Connor

Hi,

Quoted 8 lines · Naphtali Sprei

I've found a problem with the usage of SeaBIOS/gPXE in Qemu. The scenario is when failing to boot from network and falling back to booting from hard-disk (-boot nc). The cause of the problem is that both SeaBIOS and gPXE (in it's installation phase) uses same stack area, 0x7c00. The gPXE code corrupts the SeaBIOS stack, so when gPXE returns to SeaBIOS chaos occurs.

Output: "qemu: fatal: Trying to execute code outside RAM or ROM at 0x00000000eb300000"

Thanks for reporting this.

We can move the SeaBIOS stack, but it's not clear to me where to move it to. Bochs bios puts the top of the stack at 0x10000, but this could potentially conflict with the OS load to 0x7c00. So, in SeaBIOS the top of stack was moved to 0x7c00 to prevent this conflict.

Quoted 8 lines

Maybe the gPXE developers know where the bios typically places its stack.

However, I'm not sure why gPXE doesn't just use the stack it was given, or allocate the stack space it needs with PMM.

Quoted 2 lines

A simple hack/patch (attached) solves this problem, but a proper patch expected from the SeaBIOS guys.

Sorry for the misleading addressee. I should have addressed the request to the gPXE project, and not SeaBIOS project. Since the gPXE uses the services of SeaBIOS, that where the changes should be.
Thanks for CC'ing them.

Quoted 8 lines
Quoted 6 lines

Enjoy,

Naphtali

Patch against current SeaBIOS git

The patch isn't against SeaBIOS. Did you mean gPXE?

Sure, my mistake, against gPXE.

Quoted 2 lines

-Kevin

#3 lore raw
In reply to Kevin O'Connor
Quoted 20 lines · Kevin O'Connor

Hi,

Quoted 9 lines · Naphtali Sprei

I've found a problem with the usage of SeaBIOS/gPXE in Qemu. The scenario is when failing to boot from network and falling back to booting from hard-disk (-boot nc). The cause of the problem is that both SeaBIOS and gPXE (in it's installation phase) uses same stack area, 0x7c00. The gPXE code corrupts the SeaBIOS stack, so when gPXE returns to SeaBIOS chaos occurs.

Output: "qemu: fatal: Trying to execute code outside RAM or ROM at 0x00000000eb300000"

Thanks for reporting this.

We can move the SeaBIOS stack, but it's not clear to me where to move it to. Bochs bios puts the top of the stack at 0x10000, but this could potentially conflict with the OS load to 0x7c00. So, in SeaBIOS the top of stack was moved to 0x7c00 to prevent this conflict.

Quoted 6 lines

Maybe the gPXE developers know where the bios typically places its stack.

However, I'm not sure why gPXE doesn't just use the stack it was given, or allocate the stack space it needs with PMM.

Something that is likely related, I am seeing reboot failures in seabios's pmm_free. Immediately after loading gpxe, seabios is in an endless loop there, likely due to memory corruption.

This is with -smp 2, rebooting Fedora 9 after installation.

Signature · 1 line
error compiling committee.c: too many arguments to function
#4 lore raw
Quoted 22 lines · Avi Kivity
Quoted 21 lines · Kevin O'Connor

Hi,

Quoted 8 lines · Naphtali Sprei

I've found a problem with the usage of SeaBIOS/gPXE in Qemu. The scenario is when failing to boot from network and falling back to booting from hard-disk (-boot nc). The cause of the problem is that both SeaBIOS and gPXE (in it's installation phase) uses same stack area, 0x7c00. The gPXE code corrupts the SeaBIOS stack, so when gPXE returns to SeaBIOS chaos occurs.

Output: "qemu: fatal: Trying to execute code outside RAM or ROM at 0x00000000eb300000"

Thanks for reporting this.

We can move the SeaBIOS stack, but it's not clear to me where to move it to. Bochs bios puts the top of the stack at 0x10000, but this could potentially conflict with the OS load to 0x7c00. So, in SeaBIOS the top of stack was moved to 0x7c00 to prevent this conflict.

Maybe the gPXE developers know where the bios typically places its stack.

Quoted 7 lines
Quoted 2 lines

However, I'm not sure why gPXE doesn't just use the stack it was given, or allocate the stack space it needs with PMM.

Something that is likely related, I am seeing reboot failures in seabios's pmm_free. Immediately after loading gpxe, seabios is in an endless loop there, likely due to memory corruption.

This is with -smp 2, rebooting Fedora 9 after installation.

With gpxe disabled, rebooting works as expected.

Note the tests were performed with the stack at 64K to avoid triggering the known issue.

Signature · 1 line
error compiling committee.c: too many arguments to function
#5 lore raw
Quoted 10 lines · Avi Kivity
Quoted 5 lines

Something that is likely related, I am seeing reboot failures in seabios's pmm_free. Immediately after loading gpxe, seabios is in an endless loop there, likely due to memory corruption.

This is with -smp 2, rebooting Fedora 9 after installation.

With gpxe disabled, rebooting works as expected.

Note the tests were performed with the stack at 64K to avoid triggering the known issue.

Hi Avi,

Can you send the full qemu command line that you used? I can't seem to reproduce this on my setup.

I do see an issue if SeaBIOS's reboot vector is called (eg, by using "sendkey ctrl-alt-delete" while still in the bios) because seabios allows gpxe to modify itself, and on a seabios only reboot the gpxe rom isn't recopied and gpxe therefore gets confused. However, on a linux invoked reboot, it looks like a full machine reset occurs and qemu recopies the gpxe rom, so that doesn't seem to be an issue.

BTW, how did you change the stack location? I've been changing seabios by setting BUILD_STACK_ADDR to 0x7000 (or 0xfff0) in src/config.h.

-Kevin

#6 lore raw
Quoted 10 lines · Kevin O'Connor
Quoted 8 lines · Avi Kivity
Quoted 6 lines

Something that is likely related, I am seeing reboot failures in seabios's pmm_free. Immediately after loading gpxe, seabios is in an endless loop there, likely due to memory corruption.

This is with -smp 2, rebooting Fedora 9 after installation.

With gpxe disabled, rebooting works as expected.

Quoted 9 lines
Quoted 3 lines

Note the tests were performed with the stack at 64K to avoid triggering the known issue.

Hi Avi,

Can you send the full qemu command line that you used? I can't seem to reproduce this on my setup.

Example command line is

qemu -name 'vm1' -drive
file=/root/kvm-autotest/client/tests/kvm/images/winvista-64.qcow2,if=ide,cache=writeback -net nic,vlan=0,model=rtl8139,macaddr=52:54:00:12:34:56 -net user,vlan=0 -m 512 -smp 2 -cdrom /root/kvm-autotest/client/tests/kvm/isos/windows/winutils.iso -redir tcp:5000::22

(generate by autotest) with qemu-kvm.git b496fe34317ead61cf5ae019506fadc8f9ad6556.

Quoted 11 lines

I do see an issue if SeaBIOS's reboot vector is called (eg, by using "sendkey ctrl-alt-delete" while still in the bios) because seabios allows gpxe to modify itself, and on a seabios only reboot the gpxe rom isn't recopied and gpxe therefore gets confused. However, on a linux invoked reboot, it looks like a full machine reset occurs and qemu recopies the gpxe rom, so that doesn't seem to be an issue.

BTW, how did you change the stack location? I've been changing seabios by setting BUILD_STACK_ADDR to 0x7000 (or 0xfff0) in src/config.h.

I modified BUILD_STACK_ADDR as well.

Signature · 1 line
error compiling committee.c: too many arguments to function
#7 lore raw
Quoted 10 lines · Avi Kivity
Quoted 9 lines · Kevin O'Connor
Quoted 8 lines · Avi Kivity
Quoted 6 lines

Something that is likely related, I am seeing reboot failures in seabios's pmm_free. Immediately after loading gpxe, seabios is in an endless loop there, likely due to memory corruption.

This is with -smp 2, rebooting Fedora 9 after installation.

With gpxe disabled, rebooting works as expected.

Quoted 7 lines
Quoted 7 lines
Quoted 3 lines

Note the tests were performed with the stack at 64K to avoid triggering the known issue.

Hi Avi,

Can you send the full qemu command line that you used? I can't seem to reproduce this on my setup.

Hi Avi,

I'm still unable to reproduce this Fedora reboot failure.

Quoted 1 line

Example command line is

That command looks like the vista cdrom scenario. To try and reproduce the fedora reboot issue, I checked out 51a8ac6f of qemu-kvm and ran:

qemu-img create -f qcow2 test-fc9 10G

qemu-system-x86_64 -hda test-fc9 -cdrom ../../iso/Fedora-9-i386-DVD/Fedora-9-i386-DVD.iso -m 512 -smp 2

This was with the bios.bin that came with 51a8ac6f. I selected all default options (except I disabled "Software productivity tools" to make the install go faster). The machine rebooted okay after the install.

Can you retry this with the latest seabios git. If you are able to reproduce, can you set CONFIG_DEBUG_LEVEL to 8 and post the log? Maybe something in the log will help.

Thanks,
-Kevin

#8 lore raw
Quoted 5 lines · Kevin O'Connor

Can you retry this with the latest seabios git. If you are able to reproduce, can you set CONFIG_DEBUG_LEVEL to 8 and post the log? Maybe something in the log will help.

With current seabios.git the problem is resolved.

Signature · 1 line
error compiling committee.c: too many arguments to function
#9 lore raw
In reply to Kevin O'Connor
Quoted 17 lines · Kevin O'Connor
Quoted 10 lines · Avi Kivity
Quoted 5 lines

Something that is likely related, I am seeing reboot failures in seabios's pmm_free. Immediately after loading gpxe, seabios is in an endless loop there, likely due to memory corruption.

This is with -smp 2, rebooting Fedora 9 after installation.

With gpxe disabled, rebooting works as expected.

Note the tests were performed with the stack at 64K to avoid triggering the known issue.

Hi Avi,

Can you send the full qemu command line that you used? I can't seem to reproduce this on my setup.

Quoted 7 lines

I do see an issue if SeaBIOS's reboot vector is called (eg, by using "sendkey ctrl-alt-delete" while still in the bios) because seabios allows gpxe to modify itself, and on a seabios only reboot the gpxe rom isn't recopied and gpxe therefore gets confused. However, on a linux invoked reboot, it looks like a full machine reset occurs and qemu recopies the gpxe rom, so that doesn't seem to be an issue.

Do we have the same problem with tpr patching rom (vapic,bin)? It modifies itself too.

Quoted 6 lines

BTW, how did you change the stack location? I've been changing seabios by setting BUILD_STACK_ADDR to 0x7000 (or 0xfff0) in src/config.h.

-Kevin

--
Gleb.

#10 lore raw
Quoted 25 lines · Gleb Natapov
Quoted 17 lines · Kevin O'Connor
Quoted 10 lines · Avi Kivity
Quoted 5 lines

Something that is likely related, I am seeing reboot failures in seabios's pmm_free. Immediately after loading gpxe, seabios is in an endless loop there, likely due to memory corruption.

This is with -smp 2, rebooting Fedora 9 after installation.

With gpxe disabled, rebooting works as expected.

Note the tests were performed with the stack at 64K to avoid triggering the known issue.

Hi Avi,

Can you send the full qemu command line that you used? I can't seem to reproduce this on my setup.

Quoted 7 lines

I do see an issue if SeaBIOS's reboot vector is called (eg, by using "sendkey ctrl-alt-delete" while still in the bios) because seabios allows gpxe to modify itself, and on a seabios only reboot the gpxe rom isn't recopied and gpxe therefore gets confused. However, on a linux invoked reboot, it looks like a full machine reset occurs and qemu recopies the gpxe rom, so that doesn't seem to be an issue.

Quoted 2 lines

Do we have the same problem with tpr patching rom (vapic,bin)? It modifies itself too.

Are you sure vapic.bin still works with SeaBIOS? I've had to modify the multiboot and linuxboot code to write to the stack because the code section of the option rom was read only.

Alex

#11 lore raw
Quoted 30 lines · Alexander Graf
Quoted 27 lines · Gleb Natapov
Quoted 26 lines · Kevin O'Connor
Quoted 5 lines · Avi Kivity
Quoted 5 lines

Something that is likely related, I am seeing reboot failures in seabios's pmm_free. Immediately after loading gpxe, seabios is in an
endless loop there, likely due to memory corruption.

Quoted 7 lines
Quoted 1 line

This is with -smp 2, rebooting Fedora 9 after installation.

With gpxe disabled, rebooting works as expected.

Note the tests were performed with the stack at 64K to avoid triggering
the known issue.

Hi Avi,

Can you send the full qemu command line that you used? I can't seem to reproduce this on my setup.

I do see an issue if SeaBIOS's reboot vector is called (eg, by using "sendkey ctrl-alt-delete" while still in the bios) because seabios allows gpxe to modify itself, and on a seabios only reboot the gpxe rom isn't recopied and gpxe therefore gets confused. However, on a linux invoked reboot, it looks like a full machine reset occurs and qemu recopies the gpxe rom, so that doesn't seem to be an issue.

Quoted 8 lines
Quoted 3 lines

Do we have the same problem with tpr patching rom (vapic,bin)? It modifies
itself too.

Are you sure vapic.bin still works with SeaBIOS? I've had to modify the multiboot and linuxboot code to write to the stack because the code section of the option rom was read only.

I tested it with SeaBIOS and it worked. Actually vapic.bin doesn't modifies itself during BIOS run. Part of vapic.bin are modified by QEMU and other part are modified during Windows run.

--
Gleb.

#12 lore raw
In reply to Alexander Graf
Quoted 3 lines · Alexander Graf

Are you sure vapic.bin still works with SeaBIOS? I've had to modify the multiboot and linuxboot code to write to the stack because the code section of the option rom was read only.

SeaBIOS should be making the code writable during option rom execution. This is a change from bochs-bios, which did not do this.

-Kevin

#13 lore raw
In reply to Gleb Natapov
Quoted 10 lines · Gleb Natapov
Quoted 7 lines · Kevin O'Connor

I do see an issue if SeaBIOS's reboot vector is called (eg, by using "sendkey ctrl-alt-delete" while still in the bios) because seabios allows gpxe to modify itself, and on a seabios only reboot the gpxe rom isn't recopied and gpxe therefore gets confused. However, on a linux invoked reboot, it looks like a full machine reset occurs and qemu recopies the gpxe rom, so that doesn't seem to be an issue.

Do we have the same problem with tpr patching rom (vapic,bin)? It modifies itself too.

I don't know, but I wouldn't think so. The issue is only if the option rom init code doesn't like getting run twice. (Gpxe allocates high memory via pmm, relocates itself there, and shrinks its option rom size - on the second option rom init call the PMM allocation is lost and its option rom has been shrunk - it rightfully can't handle that.) I don't think the vapic would have the same issue - would it?

Ideally, I think SeaBIOS should detect a second call to "post" and try to issue a machine reboot. That should fix this issue. (To be clear though, I don't think this is the cause of Avi's Fedora reboot hang.)

-Kevin

#14 lore raw
Quoted 9 lines · Kevin O'Connor
Quoted 8 lines · Gleb Natapov
Quoted 7 lines · Kevin O'Connor

I do see an issue if SeaBIOS's reboot vector is called (eg, by using "sendkey ctrl-alt-delete" while still in the bios) because seabios allows gpxe to modify itself, and on a seabios only reboot the gpxe rom isn't recopied and gpxe therefore gets confused. However, on a linux invoked reboot, it looks like a full machine reset occurs and qemu recopies the gpxe rom, so that doesn't seem to be an issue.

Quoted 5 lines
Quoted 2 lines

Do we have the same problem with tpr patching rom (vapic,bin)? It modifies itself too.

I don't know, but I wouldn't think so. The issue is only if the option rom init code doesn't like getting run twice. (Gpxe allocates

If rom modifies itself its checksum changes so SeaBIOS thinks that rom is invalid and does not call its init code second time. Is this correct?

Quoted 10 lines

high memory via pmm, relocates itself there, and shrinks its option rom size - on the second option rom init call the PMM allocation is lost and its option rom has been shrunk - it rightfully can't handle that.) I don't think the vapic would have the same issue - would it?

Ideally, I think SeaBIOS should detect a second call to "post" and try to issue a machine reboot. That should fix this issue. (To be clear though, I don't think this is the cause of Avi's Fedora reboot hang.)

-Kevin

--
Gleb.

#15 lore raw
Quoted 10 lines · Gleb Natapov
Quoted 9 lines · Kevin O'Connor
Quoted 8 lines · Gleb Natapov
Quoted 7 lines · Kevin O'Connor

I do see an issue if SeaBIOS's reboot vector is called (eg, by using "sendkey ctrl-alt-delete" while still in the bios) because seabios allows gpxe to modify itself, and on a seabios only reboot the gpxe rom isn't recopied and gpxe therefore gets confused.  However, on a linux invoked reboot, it looks like a full machine reset occurs and qemu recopies the gpxe rom, so that doesn't seem to be an issue.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Do we have the same problem with tpr patching rom (vapic,bin)? It modifies itself too.

I don't know, but I wouldn't think so.  The issue is only if the option rom init code doesn't like getting run twice.  (Gpxe allocates

If rom modifies itself its checksum changes so SeaBIOS thinks that rom is invalid and does not call its init code second time. Is this correct?

I don't know how it's "supposed" to work, but gPXE's ROM init procedure contains code to recompute and store the checksum after it's modified itself. Presumably this is there because some vendor BIOSes expect it.

-- Josh

#16 lore raw
In reply to Gleb Natapov
Quoted 10 lines · Gleb Natapov
Quoted 9 lines · Kevin O'Connor
Quoted 8 lines · Gleb Natapov
Quoted 7 lines · Kevin O'Connor

I do see an issue if SeaBIOS's reboot vector is called (eg, by using "sendkey ctrl-alt-delete" while still in the bios) because seabios allows gpxe to modify itself, and on a seabios only reboot the gpxe rom isn't recopied and gpxe therefore gets confused. However, on a linux invoked reboot, it looks like a full machine reset occurs and qemu recopies the gpxe rom, so that doesn't seem to be an issue.

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

Do we have the same problem with tpr patching rom (vapic,bin)? It modifies itself too.

I don't know, but I wouldn't think so. The issue is only if the option rom init code doesn't like getting run twice. (Gpxe allocates

If rom modifies itself its checksum changes so SeaBIOS thinks that rom is invalid and does not call its init code second time. Is this correct?

An option rom that modifies itself is required to update its checksum before returning to the bios.

If the vapic is modified without updating the checksum then SeaBIOS wont execute its init vector. I'm guessing that isn't really a problem, though.

-Kevin

#17 lore raw
In reply to Gleb Natapov
Quoted 14 lines · Gleb Natapov
Quoted 6 lines

Hi Avi,

Can you send the full qemu command line that you used? I can't seem to reproduce this on my setup.

Quoted 8 lines

I do see an issue if SeaBIOS's reboot vector is called (eg, by using "sendkey ctrl-alt-delete" while still in the bios) because seabios allows gpxe to modify itself, and on a seabios only reboot the gpxe rom isn't recopied and gpxe therefore gets confused. However, on a linux invoked reboot, it looks like a full machine reset occurs and qemu recopies the gpxe rom, so that doesn't seem to be an issue.

Quoted 3 lines

Do we have the same problem with tpr patching rom (vapic,bin)? It modifies itself too.

But a reset will reload it.

Signature · 1 line
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
#18 lore raw
Quoted 14 lines · Avi Kivity
Quoted 13 lines · Gleb Natapov
Quoted 13 lines

Hi Avi,

Can you send the full qemu command line that you used? I can't seem to reproduce this on my setup.

I do see an issue if SeaBIOS's reboot vector is called (eg, by using "sendkey ctrl-alt-delete" while still in the bios) because seabios allows gpxe to modify itself, and on a seabios only reboot the gpxe rom isn't recopied and gpxe therefore gets confused. However, on a linux invoked reboot, it looks like a full machine reset occurs and qemu recopies the gpxe rom, so that doesn't seem to be an issue.

Quoted 5 lines
Quoted 2 lines

Do we have the same problem with tpr patching rom (vapic,bin)? It modifies itself too.

But a reset will reload it.

Correct, but Kevin says "sendkey ctrl-alt-delete" jumps to SeaBIOS's reboot vector without issuing system reset. I am talking about this situation.

--
Gleb.

#19 lore raw
Quoted 10 lines · Gleb Natapov
Quoted 7 lines
Quoted 4 lines

Do we have the same problem with tpr patching rom (vapic,bin)? It modifies itself too.

But a reset will reload it.

Correct, but Kevin says "sendkey ctrl-alt-delete" jumps to SeaBIOS's reboot vector without issuing system reset. I am talking about this situation.

That's only if we're in the bios. If an OS has taken over, it will issue a proper reset. If an OS has not taken over (DOS won't, probably) then it isn't Windows and the vapic payload hasn't had a chance to modify itself.

Signature · 1 line
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
#20 lore raw
In reply to Kevin O'Connor
Quoted 8 lines · Kevin O'Connor
Quoted 7 lines · Naphtali Sprei

I've found a problem with the usage of SeaBIOS/gPXE in Qemu. The scenario is when failing to boot from network and falling back to booting from hard-disk (-boot nc). The cause of the problem is that both SeaBIOS and gPXE (in it's installation phase) uses same stack area, 0x7c00. The gPXE code corrupts the SeaBIOS stack, so when gPXE returns to SeaBIOS chaos occurs.

Quoted 6 lines
Quoted 1 line

Output: "qemu: fatal: Trying to execute code outside RAM or ROM at 0x00000000eb300000"

Thanks for reporting this.

We can move the SeaBIOS stack, but it's not clear to me where to move it to.

I don't think this is a SeaBIOS bug, but in an effort to move forward, I've moved the SeaBIOS stack from 0x7c00 to 0x7000. Commit 494dfc6e.

-Kevin