组装-在Bochs中运行引导加载程序时出现问题 [英] Assembly - Problems running a bootloader in bochs

查看:190
本文介绍了组装-在Bochs中运行引导加载程序时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在尝试在bochs中编译并运行一个简单的bootloader.当前,这是我的bootloader.asm文件:

I am currently trying to compile and run a simple bootloader in bochs. Currently, this is my bootloader.asm file:

[BITS 16]
[ORG 0x7C00] ;Where the code gets mapped
top:
    jmp top ;Loop forever
times 510-($-$$) db 0 ;Pad with 0
dw 0xAA55 ;Bootloader signature (backwards)
    ;; dw declares a word (2 bytes because we’re 16 bits)

然后从我的pragmalinux-img目录键入以下命令:

From my pragmalinux-img directory I then type in the following commands:

yasm bootloader.asm
dd if=bootloader bs=512 
bochs

运行boch时,出现以下错误消息.(很抱歉,没有文字提示)

Upon running bochs I get the following error message. (Sorry for the wall of text)

                        Bochs x86 Emulator 2.6
            Built from SVN snapshot on September 2nd, 2012
========================================================================
00000000000i[     ] LTDL_LIBRARY_PATH not set. using compile time default        '/usr/lib/bochs/plugins'
00000000000i[     ] BXSHARE not set. using compile time default '/usr/share/bochs'
00000000000i[     ] lt_dlhandle is 0x2d78540
00000000000i[PLGIN] loaded plugin libbx_unmapped.so
00000000000i[     ] lt_dlhandle is 0x2d79270
00000000000i[PLGIN] loaded plugin libbx_biosdev.so
00000000000i[     ] lt_dlhandle is 0x2d79bf0
00000000000i[PLGIN] loaded plugin libbx_speaker.so
00000000000i[     ] lt_dlhandle is 0x2d7b2d0
00000000000i[PLGIN] loaded plugin libbx_extfpuirq.so
00000000000i[     ] lt_dlhandle is 0x2d7bbf0
00000000000i[PLGIN] loaded plugin libbx_parallel.so
00000000000i[     ] lt_dlhandle is 0x2d7d7c0
00000000000i[PLGIN] loaded plugin libbx_serial.so
00000000000i[     ] lt_dlhandle is 0x2d813a0
00000000000i[PLGIN] loaded plugin libbx_gameport.so
00000000000i[     ] lt_dlhandle is 0x2d81e40
00000000000i[PLGIN] loaded plugin libbx_iodebug.so
00000000000i[     ] reading configuration from bochsrc
00000000000e[     ] bochsrc:9: 'vga_update_interval' will be replaced by new 'vga: update_freq' option.
00000000000e[     ] bochsrc:10: 'i440fxsupport' will be replaced by new 'pci' option.
00000000000i[     ] lt_dlhandle is (nil)
00000000000p[     ] >>PANIC<< dlopen failed for module 'sdl': file not found
========================================================================
Event type: PANIC
Device: [     ]
Message: dlopen failed for module 'sdl': file not found

A PANIC has occurred.  Do you want to:
  cont       - continue execution
  alwayscont - continue execution, and don't ask again.
               This affects only PANIC events from device [     ]
  die        - stop execution now
  abort      - dump core 
  debug      - continue and return to bochs debugger
Choose one of the actions above: [die] die
00000000000i[CPU0 ] CPU is in real mode (active)
00000000000i[CPU0 ] CS.mode = 16 bit
00000000000i[CPU0 ] SS.mode = 16 bit
00000000000i[CPU0 ] EFER   = 0x00000000
00000000000i[CPU0 ] | EAX=00000000  EBX=00000000  ECX=00000000  EDX=00000000
00000000000i[CPU0 ] | ESP=00000000  EBP=00000000  ESI=00000000  EDI=00000000
00000000000i[CPU0 ] | IOPL=0 id vip vif ac vm rf nt of df if tf sf ZF af PF cf
00000000000i[CPU0 ] | SEG sltr(index|ti|rpl)     base    limit G D
00000000000i[CPU0 ] |  CS:0000( 0000| 0|  0) 00000000 00000000 0 0
00000000000i[CPU0 ] |  DS:0000( 0000| 0|  0) 00000000 00000000 0 0
00000000000i[CPU0 ] |  SS:0000( 0000| 0|  0) 00000000 00000000 0 0
00000000000i[CPU0 ] |  ES:0000( 0000| 0|  0) 00000000 00000000 0 0
00000000000i[CPU0 ] |  FS:0000( 0000| 0|  0) 00000000 00000000 0 0
00000000000i[CPU0 ] |  GS:0000( 0000| 0|  0) 00000000 00000000 0 0
00000000000i[CPU0 ] | EIP=00000000 (00000000)
00000000000i[CPU0 ] | CR0=0x00000000 CR2=0x00000000
00000000000i[CPU0 ] | CR3=0x00000000 CR4=0x00000000
bx_dbg_read_linear: physical memory read error (phy=0x0000000000000000, lin=0x0000000000000000)
00000000000i[CTRL ] quit_sim called with exit code 1

我是组装和这种东西的新手,所以可以提供任何帮助.谢谢.

I'm new to assembly and this type of thing so any help is appreciated. Thanks.

推荐答案

由于@Someprogrammerdude的提示,已将其修复.刚跑:

Fixed it due to @Someprogrammerdude's hint. Just ran:

sudo apt-get install bochs-sdl 

,很快就解决了.应该注意的是我也跑过了:

and it was soon fixed. Should be noted I also ran:

sudo apt-get install bochs-x 

在以前的旧论坛帖子的建议下进行.可能对解决方案有影响.

prior to that on the advice of an old forum post. Might have had a bearing in the fix.

这篇关于组装-在Bochs中运行引导加载程序时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆