copy / v86

x86 PC emulator and x86-to-wasm JIT, running in the browser
https://copy.sh/v86/
BSD 2-Clause "Simplified" License
19.55k stars 1.36k forks source link

Alpine Linux Issue #1069

Closed evonox closed 1 month ago

evonox commented 1 month ago

Hi all, I ran into this error with the build of Alpine distro. I use the latest version of the emulator and I have built Alpine using the Docker.

image

What am I doing wrong?

SuperMaxusa commented 1 month ago

About NMI selftest errors: probably https://github.com/copy/v86/issues/797 About IRQ errors: can you try adding irqpoll to cmdline?

--- a/alpine.html
+++ b/alpine.html
@@ -18,7 +18,7 @@ window.onload = function()
         },
         autostart: true,
         bzimage_initrd_from_filesystem: true,
-        cmdline: "rw root=host9p rootfstype=9p rootflags=trans=virtio,cache=loose modules=virtio_pci tsc=reliable",
+        cmdline: "rw root=host9p rootfstype=9p rootflags=trans=virtio,cache=loose modules=virtio_pci tsc=reliable irqpoll",
         //initial_state: { url: "../images/alpine-state.bin" },
     });
 };
coderofsalvation commented 1 month ago

I've tried this fix, it gives this (same?) output:

[   62.464666]  ? __irq_disable+0xa0/0xa0                                       
[   62.464666]  ? handle_level_irq+0x7c/0x160                                   
[   62.464666]  ? __handle_irq+0x9e/0x100                                       
[   62.464666]  </IRQ>                                                          
[   62.464666]  ? __common_interrupt+0x36/0xa0                                  
[   62.464666]  ? common_interrupt+0x2a/0x50                                    
[   62.464666]  ? asm_common_interrupt+0x102/0x140                              
[   62.464666]  ? __SCT__tp_func_ipi_exit+0x8/0x8                               
[   62.464666]  ? __SCT__tp_func_ipi_exit+0x8/0x8                               
[   62.464666]  ? delay_tsc+0xbd/0xe0                                           
[   62.464666]  __const_udelay+0x31/0x40                                        
[   62.464666]  test_nmi_ipi.constprop.0+0x98/0xf0                              
[   62.464666]  nmi_selftest+0x140/0x3b0                                        
[   62.464666]  native_smp_cpus_done+0x157/0x270                                
[   62.464666]  smp_init+0x6e/0xa0                                              
[   62.464666]  kernel_init_freeable+0x143/0x450                                
[   62.464666]  ? rest_init+0xc0/0xc0                                           
[   62.464666]  ? calculate_sigpending+0x2f/0x40                                
[   62.464666]  ? rest_init+0xc0/0xc0                                           
[   62.464666]  kernel_init+0x17/0x1a0                                          
[   62.464666]  ret_from_fork+0x38/0x60                                         
[   62.464666]  ? rest_init+0xc0/0xc0                                           
[   62.464666]  ret_from_fork_asm+0x12/0x20                                     
[   62.464666]  entry_INT80_32+0xf0/0xf5   

iirc correctly it had something to do with later Alpine kernels being built with a certain different default. (TBH I've googled this a while ago (when I ran into it) and read somewhere (can't find the link) )

SuperMaxusa commented 1 month ago

it gives this (same?) output

If I correctly understand, this message can be repeated several times in log. On Node.JS (for example, run build-state.js) does this also happen?

evonox commented 1 month ago

What might be the causes that the kernel cannot cannot find host9p device? Should the 9p FS drivers be statically linked to kernel or can they be dynamically loaded? image

SuperMaxusa commented 1 month ago

What might be the causes that the kernel cannot cannot find host9p device?

The 9p(net): ... lines are appeared in your log? Also check these kernel parameters: rootfstype=9p rootflags=trans=virtio

evonox commented 1 month ago

Thank you. I was bulding the old distro Ubuntu 18.04 which kernel did not have support for 9P. I have built the latest kernel available that has it turned on by default and it works.

copy commented 1 month ago

This is the same as https://github.com/copy/v86/issues/797. There's a fix in the wip branch.

copy commented 1 month ago

This should be fixed now.