Bochs panics even with just minimal boot code

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
jrhetf4xb
Member
Member
Posts: 38
Joined: Fri May 16, 2014 11:50 am
Location: Bulgaria

Bochs panics even with just minimal boot code

Post by jrhetf4xb »

Hi,

I started using Bochs in order to get some more CPU information because VirtualBox doesn't help me much (that's what I've used so far). And to my surprise Bochs panics the same way irrespective of what code I supply it with. The error I get is always this:

Code: Select all

Event type: PANIC
Device: [CPU0 ]
Message: prefetch: getHostMemAddr vetoed direct read, pAddr=0x00000000000a4ede
I've stripped down my bootloader code to just this piece:

Code: Select all

.code16
.section .text
    .globl boot0

boot0:
    cli
    jmp halt
        
  halt:
    jmp halt
And I still get the error! I've had no issues with VirtualBox so far...

And here is a piece of the log file, the last line (LOCK prefix etc.) starts getting repeated thousands of times after it, including many more:

Code: Select all

00000000000i[SYS  ] bx_pc_system_c::Reset(HARDWARE) called
00000000000i[CPU0 ] cpu hardware reset
00000000000i[APIC0] allocate APIC id=0 (MMIO enabled) to 0x00000000fee00000
00000000000i[CPU0 ] CPUID[0x00000000]: 00000003 756e6547 6c65746e 49656e69
00000000000i[CPU0 ] CPUID[0x00000001]: 00000f23 00000800 00002000 07cbfbff
00000000000i[CPU0 ] CPUID[0x00000002]: 00410601 00000000 00000000 00000000
00000000000i[CPU0 ] CPUID[0x00000003]: 00000000 00000000 00000000 00000000
00000000000i[CPU0 ] CPUID[0x00000004]: 00000000 00000000 00000000 00000000
00000000000i[CPU0 ] CPUID[0x00000007]: 00000000 00000000 00000000 00000000
00000000000i[CPU0 ] CPUID[0x80000000]: 80000008 00000000 00000000 00000000
00000000000i[CPU0 ] CPUID[0x80000001]: 00000000 00000000 00000001 2a100800
00000000000i[CPU0 ] CPUID[0x80000002]: 20202020 20202020 20202020 6e492020
00000000000i[CPU0 ] CPUID[0x80000003]: 286c6574 50202952 69746e65 52286d75
00000000000i[CPU0 ] CPUID[0x80000004]: 20342029 20555043 20202020 00202020
00000000000i[CPU0 ] CPUID[0x80000006]: 00000000 42004200 02008140 00000000
00000000000i[CPU0 ] CPUID[0x80000007]: 00000000 00000000 00000000 00000000
00000000000i[CPU0 ] CPUID[0x80000008]: 00003028 00000000 00000000 00000000
00000000000i[PLGIN] reset of 'unmapped' plugin device by virtual method
00000000000i[PLGIN] reset of 'biosdev' plugin device by virtual method
00000000000i[PLGIN] reset of 'speaker' plugin device by virtual method
00000000000i[PLGIN] reset of 'extfpuirq' plugin device by virtual method
00000000000i[PLGIN] reset of 'gameport' plugin device by virtual method
00000000000i[PLGIN] reset of 'pci_ide' plugin device by virtual method
00000000000i[PLGIN] reset of 'acpi' plugin device by virtual method
00000000000i[PLGIN] reset of 'ioapic' plugin device by virtual method
00000000000i[PLGIN] reset of 'keyboard' plugin device by virtual method
00000000000i[PLGIN] reset of 'harddrv' plugin device by virtual method
00000000000i[PLGIN] reset of 'serial' plugin device by virtual method
00000000000i[PLGIN] reset of 'parallel' plugin device by virtual method
00000000000i[PLGIN] reset of 'sb16' plugin device by virtual method
00000032737i[CPU0 ] LOCK prefix unallowed (op1=0x2, modrm=0x00)
Could someone help me with this?
Practice makes perfect.
Octocontrabass
Member
Member
Posts: 5590
Joined: Mon Mar 25, 2013 7:01 pm

Re: Bochs panics even with just minimal boot code

Post by Octocontrabass »

Why isn't Bochs running its BIOS?
User avatar
jrhetf4xb
Member
Member
Posts: 38
Joined: Fri May 16, 2014 11:50 am
Location: Bulgaria

Re: Bochs panics even with just minimal boot code

Post by jrhetf4xb »

Octocontrabass wrote:Why isn't Bochs running its BIOS?
Sorry, I don't understand. Is this a request to provide some of my files (configuration)? :D
The log file says the BIOS should be loaded...

Code: Select all

00000000000i[MEM0 ] allocated memory at 0xb42ad008. after alignment, vector=0xb42ae000
00000000000i[MEM0 ] 32.00MB
00000000000i[MEM0 ] mem block size = 0x00100000, blocks=32
00000000000i[MEM0 ] rom at 0xe0000/131072 ('/usr/share/bochs/BIOS-bochs-latest')
00000000000i[MEM0 ] rom at 0xc0000/40448 ('/usr/share/vgabios/vgabios.bin')
Practice makes perfect.
User avatar
xenos
Member
Member
Posts: 1121
Joined: Thu Aug 11, 2005 11:00 pm
Libera.chat IRC: xenos1984
Location: Tartu, Estonia
Contact:

Re: Bochs panics even with just minimal boot code

Post by xenos »

Which Bochs version are you using, what is the command line and what does your (full) bochsrc file look like? It would also be helpful to see the full log output (except for the repeated line).
Programmers' Hardware Database // GitHub user: xenos1984; OS project: NOS
User avatar
jrhetf4xb
Member
Member
Posts: 38
Joined: Fri May 16, 2014 11:50 am
Location: Bulgaria

Re: Bochs panics even with just minimal boot code

Post by jrhetf4xb »

Bochs version is 2.4.6
I attached the src and log files
Attachments
bochslog.txt
(58.62 KiB) Downloaded 44 times
bochsrc.txt
(1.05 KiB) Downloaded 95 times
Practice makes perfect.
Octocontrabass
Member
Member
Posts: 5590
Joined: Mon Mar 25, 2013 7:01 pm

Re: Bochs panics even with just minimal boot code

Post by Octocontrabass »

Bochs is executing garbage instead of the BIOS. Normally, the BIOS will print several diagnostic strings to the log while it executes. Are you sure /usr/share/bochs/BIOS-bochs-latest exists and is the correct file?

Additionally, that version of Bochs is over 3 years old. You should consider updating to a newer version.
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Bochs panics even with just minimal boot code

Post by Brendan »

Hi,
jrhetf4xb wrote:Bochs version is 2.4.6
I attached the src and log files
Try changing this:

Code: Select all

romimage: file=/usr/share/bochs/BIOS-bochs-latest, address=0xe0000
To this:

Code: Select all

romimage: file=/usr/share/bochs/BIOS-bochs-latest
Even for Bochs, I think the firmware should be loaded just below 0x0000000100000000 (just like in a modern real computer) and not just below 0x00100000 (like an ancient 8086). Fortunately Bochs is able to figure out the size of the ROM and calculate the address itself, so you don't need to (unless you're doing something very strange).


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
User avatar
jrhetf4xb
Member
Member
Posts: 38
Joined: Fri May 16, 2014 11:50 am
Location: Bulgaria

Re: Bochs panics even with just minimal boot code

Post by jrhetf4xb »

It works now, thank you!

As for updating to a newer version, I'm using a Linux image I was supplied with for VirtualBox and it had this version of Bochs installed. Will definitely update as soon as I understand how to do it (new Linux user here)...
Practice makes perfect.
seuti
Member
Member
Posts: 74
Joined: Tue Aug 19, 2014 1:20 pm

Re: Bochs panics even with just minimal boot code

Post by seuti »

jrhetf4xb wrote:new Linux user here
If you are running it in a Virtual Machine, take snapshots before you do something so then you can revert to them if something goes wrong.
The best way to learn is just by trying it, and when you can't figure it out just try Google.
Post Reply