作为Ubuntu新手,记录下自己的傻逼历程

来源:互联网 发布:恒璞网络信息 编辑:程序博客网 时间:2024/04/28 06:12

今天操作系统装Bochs,老师的那本书中提到了bochs的debug,于是自己也想尝试一下,可是总是不会对啊

错误是这样的:

========================================================================                       Bochs x86 Emulator 2.4.6             Build from CVS snapshot, on February 22, 2011                   Compiled at Nov 11 2011, 09:31:18========================================================================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'00000000000e[     ] Switching off quick start, because no configuration file was found.------------------------------Bochs Configuration: Main Menu------------------------------This is the Bochs Configuration Interface, where you can describe themachine that you want to simulate.  Bochs has already searched for aconfiguration file (typically called bochsrc.txt) and loaded it if itcould be found.  When you are satisfied with the configuration, goahead and start the simulation.You can also start bochs with the -q option to skip these menus.1. Restore factory default configuration2. Read options from...3. Edit options4. Save options to...5. Restore the Bochs state from...6. Begin simulation7. Quit nowPlease choose one: [2] 600000000000i[     ] lt_dlhandle is 0x247498000000000000i[PLGIN] loaded plugin libbx_x.so00000000000i[     ] installing x module as the Bochs GUI00000000000i[     ] Bochs x86 Emulator 2.4.600000000000i[     ]   Build from CVS snapshot, on February 22, 201100000000000i[     ] Compiled at Nov 11 2011, 09:31:1800000000000i[     ] System configuration00000000000i[     ]   processors: 1 (cores=1, HT threads=1)00000000000i[     ]   A20 line support: yes00000000000i[     ] CPU configuration00000000000i[     ]   level: 600000000000i[     ]   SMP support: no00000000000i[     ]   APIC support: yes00000000000i[     ]   FPU support: yes00000000000i[     ]   MMX support: yes00000000000i[     ]   3dnow! support: no00000000000i[     ]   SEP support: yes00000000000i[     ]   SSE support: sse200000000000i[     ]   XSAVE support: no00000000000i[     ]   AES support: no00000000000i[     ]   MOVBE support: no00000000000i[     ]   x86-64 support: yes00000000000i[     ]   1G paging support: no00000000000i[     ]   VMX support: no00000000000i[     ] Optimization configuration00000000000i[     ]   RepeatSpeedups support: yes00000000000i[     ]   Trace cache support: yes00000000000i[     ]   Fast function calls: yes00000000000i[     ] Devices configuration00000000000i[     ]   ACPI support: yes00000000000i[     ]   NE2000 support: yes00000000000i[     ]   PCI support: yes, enabled=yes00000000000i[     ]   SB16 support: yes00000000000i[     ]   USB support: yes00000000000i[     ]   VGA extension support: vbe 00000000000i[MEM0 ] allocated memory at 0x7f55c9baa010. after alignment, vector=0x7f55c9bab00000000000000i[MEM0 ] 32.00MB00000000000i[MEM0 ] mem block size = 0x00100000, blocks=3200000000000i[MEM0 ] rom at 0xfffe0000/131072 ('/usr/share/bochs/BIOS-bochs-latest')00000000000i[MEM0 ] rom at 0xc0000/40448 ('/usr/share/bochs/VGABIOS-lgpl-latest')00000000000i[     ] lt_dlhandle is 0x24cf53000000000000i[PLGIN] loaded plugin libbx_cmos.so00000000000i[     ] lt_dlhandle is 0x24cff5000000000000i[PLGIN] loaded plugin libbx_dma.so00000000000i[     ] lt_dlhandle is 0x24d09b000000000000i[PLGIN] loaded plugin libbx_pic.so00000000000i[     ] lt_dlhandle is 0x24d11f000000000000i[PLGIN] loaded plugin libbx_pit.so00000000000i[     ] lt_dlhandle is 0x24d1b6000000000000i[PLGIN] loaded plugin libbx_vga.so00000000000i[     ] lt_dlhandle is 0x24d229000000000000i[PLGIN] loaded plugin libbx_hdimage.so00000000000i[     ] lt_dlhandle is 0x24d2b5000000000000i[PLGIN] loaded plugin libbx_floppy.so00000000000i[     ] lt_dlhandle is 0x24d374000000000000i[PLGIN] loaded plugin libbx_soundmod.so00000000000i[     ] lt_dlhandle is 0x24d4d9000000000000i[PLGIN] loaded plugin libbx_pci.so00000000000i[     ] lt_dlhandle is 0x24d59c000000000000i[PLGIN] loaded plugin libbx_pci2isa.so00000000000i[     ] lt_dlhandle is 0x24d62e000000000000i[PLGIN] loaded plugin libbx_usb_common.so00000000000i[     ] lt_dlhandle is 0x24d6b2000000000000i[PLGIN] loaded plugin libbx_unmapped.so00000000000i[     ] lt_dlhandle is 0x24d739000000000000i[PLGIN] loaded plugin libbx_biosdev.so00000000000i[     ] lt_dlhandle is 0x24d7ca000000000000i[PLGIN] loaded plugin libbx_speaker.so00000000000i[     ] lt_dlhandle is 0x24d84d000000000000i[PLGIN] loaded plugin libbx_extfpuirq.so00000000000i[     ] lt_dlhandle is 0x24d8d4000000000000i[PLGIN] loaded plugin libbx_gameport.so00000000000i[     ] lt_dlhandle is 0x24d96b000000000000i[PLGIN] loaded plugin libbx_pci_ide.so00000000000i[     ] lt_dlhandle is 0x24da08000000000000i[PLGIN] loaded plugin libbx_acpi.so00000000000i[     ] lt_dlhandle is 0x24da9c000000000000i[PLGIN] loaded plugin libbx_ioapic.so00000000000i[     ] lt_dlhandle is 0x24db37000000000000i[PLGIN] loaded plugin libbx_keyboard.so00000000000i[     ] lt_dlhandle is 0x24dbb7000000000000i[PLGIN] loaded plugin libbx_harddrv.so00000000000i[     ] lt_dlhandle is 0x24edc4000000000000i[PLGIN] loaded plugin libbx_serial.so00000000000i[     ] lt_dlhandle is 0x24eeab000000000000i[PLGIN] loaded plugin libbx_parallel.so00000000000i[CMOS ] Using local time for initial clock00000000000i[CMOS ] Setting initial clock to: Wed Mar 20 02:22:26 2013 (time0=1363717346)00000000000i[DMA  ] channel 4 used by cascade00000000000i[DMA  ] channel 2 used by Floppy Drive00000000000i[PCI  ] 440FX Host bridge present at device 0, function 000000000000i[PCI  ] PIIX3 PCI-to-ISA bridge present at device 1, function 000000000000i[VGA  ] interval=5000000000000000i[MEM0 ] Register memory access handlers: 0x00000000000a0000 - 0x00000000000bffff00000000000i[XGUI ] test_alloc_colors: 16 colors available out of 16 colors tried00000000000i[XGUI ] font 8 wide x 16 high, display depth = 24bochs-bin: symbol lookup error: /usr/lib/bochs/plugins/libbx_x.so: undefined symbol: XpmCreatePixmapFromData

总是有
bochs-bin: symbol lookup error: /usr/lib/bochs/plugins/libbx_x.so: undefined symbol: XpmCreatePixmapFromData
的错误,一看到error,程序员难免会发慌,于是google下,说是配置文件的问题。

作为一个菜鸟级人物,我就不懂了,配置文件在哪里啊?在里面加display_library: sdl ??

不过看助教的ppt上见过这玩意儿,想起来是有个bochsrc文件,把它放到桌面上,就能了,就没有error了

========================================================================                       Bochs x86 Emulator 2.4.6             Build from CVS snapshot, on February 22, 2011                   Compiled at Nov 11 2011, 09:31:18========================================================================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[     ] reading configuration from bochsrc00000000000i[     ] lt_dlhandle is 0x1f6aa1000000000000i[PLGIN] loaded plugin libbx_sdl.so00000000000i[     ] installing sdl module as the Bochs GUI00000000000i[     ] Bochs x86 Emulator 2.4.600000000000i[     ]   Build from CVS snapshot, on February 22, 201100000000000i[     ] Compiled at Nov 11 2011, 09:31:1800000000000i[     ] System configuration00000000000i[     ]   processors: 1 (cores=1, HT threads=1)00000000000i[     ]   A20 line support: yes00000000000i[     ] CPU configuration00000000000i[     ]   level: 600000000000i[     ]   SMP support: no00000000000i[     ]   APIC support: yes00000000000i[     ]   FPU support: yes00000000000i[     ]   MMX support: yes00000000000i[     ]   3dnow! support: no00000000000i[     ]   SEP support: yes00000000000i[     ]   SSE support: sse200000000000i[     ]   XSAVE support: no00000000000i[     ]   AES support: no00000000000i[     ]   MOVBE support: no00000000000i[     ]   x86-64 support: yes00000000000i[     ]   1G paging support: no00000000000i[     ]   VMX support: no00000000000i[     ] Optimization configuration00000000000i[     ]   RepeatSpeedups support: yes00000000000i[     ]   Trace cache support: yes00000000000i[     ]   Fast function calls: yes00000000000i[     ] Devices configuration00000000000i[     ]   ACPI support: yes00000000000i[     ]   NE2000 support: yes00000000000i[     ]   PCI support: yes, enabled=yes00000000000i[     ]   SB16 support: yes00000000000i[     ]   USB support: yes00000000000i[     ]   VGA extension support: vbe 00000000000i[MEM0 ] allocated memory at 0x7f942d4d2010. after alignment, vector=0x7f942d4d300000000000000i[MEM0 ] 32.00MB00000000000i[MEM0 ] mem block size = 0x00100000, blocks=3200000000000i[MEM0 ] rom at 0xfffe0000/131072 ('/usr/share/bochs/BIOS-bochs-latest')00000000000i[MEM0 ] rom at 0xc0000/40448 ('/usr/share/bochs/VGABIOS-lgpl-latest')00000000000i[     ] lt_dlhandle is 0x1fcd69000000000000i[PLGIN] loaded plugin libbx_cmos.so00000000000i[     ] lt_dlhandle is 0x1fce0b000000000000i[PLGIN] loaded plugin libbx_dma.so00000000000i[     ] lt_dlhandle is 0x1fceb1000000000000i[PLGIN] loaded plugin libbx_pic.so00000000000i[     ] lt_dlhandle is 0x1fcf35000000000000i[PLGIN] loaded plugin libbx_pit.so00000000000i[     ] lt_dlhandle is 0x1fcfcc000000000000i[PLGIN] loaded plugin libbx_vga.so00000000000i[     ] lt_dlhandle is 0x1fd03f000000000000i[PLGIN] loaded plugin libbx_hdimage.so00000000000i[     ] lt_dlhandle is 0x1fd0cd000000000000i[PLGIN] loaded plugin libbx_floppy.so00000000000i[     ] lt_dlhandle is 0x1fd189000000000000i[PLGIN] loaded plugin libbx_soundmod.so00000000000i[     ] lt_dlhandle is 0x1fd211000000000000i[PLGIN] loaded plugin libbx_pci.so00000000000i[     ] lt_dlhandle is 0x1fd2cd000000000000i[PLGIN] loaded plugin libbx_pci2isa.so00000000000i[     ] lt_dlhandle is 0x1fd361000000000000i[PLGIN] loaded plugin libbx_usb_common.so00000000000i[     ] lt_dlhandle is 0x1fd3e7000000000000i[PLGIN] loaded plugin libbx_unmapped.so00000000000i[     ] lt_dlhandle is 0x1fd46e000000000000i[PLGIN] loaded plugin libbx_biosdev.so00000000000i[     ] lt_dlhandle is 0x1fd50b000000000000i[PLGIN] loaded plugin libbx_speaker.so00000000000i[     ] lt_dlhandle is 0x1fd584000000000000i[PLGIN] loaded plugin libbx_extfpuirq.so00000000000i[     ] lt_dlhandle is 0x1fd60b000000000000i[PLGIN] loaded plugin libbx_gameport.so00000000000i[     ] lt_dlhandle is 0x1fd6a2000000000000i[PLGIN] loaded plugin libbx_pci_ide.so00000000000i[     ] lt_dlhandle is 0x1fd73f000000000000i[PLGIN] loaded plugin libbx_acpi.so00000000000i[     ] lt_dlhandle is 0x1fd7d3000000000000i[PLGIN] loaded plugin libbx_ioapic.so00000000000i[     ] lt_dlhandle is 0x1fd86e000000000000i[PLGIN] loaded plugin libbx_keyboard.so00000000000i[     ] lt_dlhandle is 0x1fd8ee000000000000i[PLGIN] loaded plugin libbx_harddrv.so00000000000i[     ] lt_dlhandle is 0x1feafb000000000000i[PLGIN] loaded plugin libbx_serial.so00000000000i[     ] lt_dlhandle is 0x1febe2000000000000i[PLGIN] loaded plugin libbx_parallel.so00000000000i[CMOS ] Using local time for initial clock00000000000i[CMOS ] Setting initial clock to: Wed Mar 20 02:27:57 2013 (time0=1363717677)00000000000i[DMA  ] channel 4 used by cascade00000000000i[DMA  ] channel 2 used by Floppy Drive00000000000i[FDD  ] tried to open 'a.img' read/write: 没有那个文件或目录00000000000i[FDD  ] tried to open 'a.img' read only: 没有那个文件或目录00000000000i[PCI  ] 440FX Host bridge present at device 0, function 000000000000i[PCI  ] PIIX3 PCI-to-ISA bridge present at device 1, function 000000000000i[VGA  ] interval=5000000000000000i[MEM0 ] Register memory access handlers: 0x00000000000a0000 - 0x00000000000bffff00000000000i[MEM0 ] Register memory access handlers: 0x00000000e0000000 - 0x00000000e0ffffff00000000000i[VGA  ] VBE Bochs Display Extension Enabled00000000000i[PLGIN] init_dev of 'unmapped' plugin device by virtual method00000000000i[PLGIN] init_dev of 'biosdev' plugin device by virtual method00000000000i[PLGIN] init_dev of 'speaker' plugin device by virtual method00000000000i[SPEAK] Failed to open /dev/console: 资源暂时不可用00000000000i[SPEAK] Deactivating beep on console00000000000i[PLGIN] init_dev of 'extfpuirq' plugin device by virtual method00000000000i[PLGIN] init_dev of 'gameport' plugin device by virtual method00000000000i[PLGIN] init_dev of 'pci_ide' plugin device by virtual method00000000000i[PCI  ] PIIX3 PCI IDE controller present at device 1, function 100000000000i[PLGIN] init_dev of 'acpi' plugin device by virtual method00000000000i[PCI  ] ACPI Controller present at device 1, function 300000000000i[PLGIN] init_dev of 'ioapic' plugin device by virtual method00000000000i[IOAP ] initializing I/O APIC00000000000i[MEM0 ] Register memory access handlers: 0x00000000fec00000 - 0x00000000fec00fff00000000000i[PLGIN] init_dev of 'keyboard' plugin device by virtual method00000000000i[KBD  ] will paste characters every 1000 keyboard ticks00000000000i[PLGIN] init_dev of 'harddrv' plugin device by virtual method00000000000i[HD   ] Using boot sequence floppy, none, none00000000000i[HD   ] Floppy boot signature check is enabled00000000000i[PLGIN] init_dev of 'serial' plugin device by virtual method00000000000i[SER  ] com1 at 0x03f8 irq 400000000000i[PLGIN] init_dev of 'parallel' plugin device by virtual method00000000000i[PAR  ] parallel port 1 at 0x0378 irq 700000000000i[PLGIN] register state of 'unmapped' plugin device by virtual method00000000000i[PLGIN] register state of 'biosdev' plugin device by virtual method00000000000i[PLGIN] register state of 'speaker' plugin device by virtual method00000000000i[PLGIN] register state of 'extfpuirq' plugin device by virtual method00000000000i[PLGIN] register state of 'gameport' plugin device by virtual method00000000000i[PLGIN] register state of 'pci_ide' plugin device by virtual method00000000000i[PLGIN] register state of 'acpi' plugin device by virtual method00000000000i[PLGIN] register state of 'ioapic' plugin device by virtual method00000000000i[PLGIN] register state of 'keyboard' plugin device by virtual method00000000000i[PLGIN] register state of 'harddrv' plugin device by virtual method00000000000i[PLGIN] register state of 'serial' plugin device by virtual method00000000000i[PLGIN] register state of 'parallel' plugin device by virtual method00000000000i[SYS  ] bx_pc_system_c::Reset(HARDWARE) called00000000000i[CPU0 ] cpu hardware reset00000000000i[APIC0] allocate APIC id=0 (MMIO enabled) to 0x00000000fee0000000000000000i[CPU0 ] CPUID[0x00000000]: 00000003 756e6547 6c65746e 49656e6900000000000i[CPU0 ] CPUID[0x00000001]: 00000f23 00000800 00002000 07cbfbff00000000000i[CPU0 ] CPUID[0x00000002]: 00410601 00000000 00000000 0000000000000000000i[CPU0 ] CPUID[0x00000003]: 00000000 00000000 00000000 0000000000000000000i[CPU0 ] CPUID[0x00000004]: 00000000 00000000 00000000 0000000000000000000i[CPU0 ] CPUID[0x00000007]: 00000000 00000000 00000000 0000000000000000000i[CPU0 ] CPUID[0x80000000]: 80000008 00000000 00000000 0000000000000000000i[CPU0 ] CPUID[0x80000001]: 00000000 00000000 00000001 2a10080000000000000i[CPU0 ] CPUID[0x80000002]: 20202020 20202020 20202020 6e49202000000000000i[CPU0 ] CPUID[0x80000003]: 286c6574 50202952 69746e65 52286d7500000000000i[CPU0 ] CPUID[0x80000004]: 20342029 20555043 20202020 0020202000000000000i[CPU0 ] CPUID[0x80000006]: 00000000 42004200 02008140 0000000000000000000i[CPU0 ] CPUID[0x80000007]: 00000000 00000000 00000000 0000000000000000000i[CPU0 ] CPUID[0x80000008]: 00003028 00000000 00000000 0000000000000000000i[PLGIN] reset of 'unmapped' plugin device by virtual method00000000000i[PLGIN] reset of 'biosdev' plugin device by virtual method00000000000i[PLGIN] reset of 'speaker' plugin device by virtual method00000000000i[PLGIN] reset of 'extfpuirq' plugin device by virtual method00000000000i[PLGIN] reset of 'gameport' plugin device by virtual method00000000000i[PLGIN] reset of 'pci_ide' plugin device by virtual method00000000000i[PLGIN] reset of 'acpi' plugin device by virtual method00000000000i[PLGIN] reset of 'ioapic' plugin device by virtual method00000000000i[PLGIN] reset of 'keyboard' plugin device by virtual method00000000000i[PLGIN] reset of 'harddrv' plugin device by virtual method00000000000i[PLGIN] reset of 'serial' plugin device by virtual method00000000000i[PLGIN] reset of 'parallel' plugin device by virtual method00000003305i[BIOS ] $Revision: 1.257 $ $Date: 2011/01/26 09:52:02 $00000318042i[KBD  ] reset-disable command received00000442356i[VBIOS] VGABios $Id$00000442427i[VGA  ] VBE known Display Interface b0c000000442459i[VGA  ] VBE known Display Interface b0c500000443128i[VBIOS] VBE Bios $Id$00000760600i[BIOS ] Starting rombios3200000761033i[BIOS ] Shutdown flag 000000761628i[BIOS ] ram_size=0x0200000000000762048i[BIOS ] ram_end=32MB00000802574i[BIOS ] Found 1 cpu(s)00000818429i[BIOS ] bios_table_addr: 0x000fb928 end=0x000fcc0000000818526i[PCI  ] 440FX PMC write to PAM register 59 (TLB Flush)00001146221i[PCI  ] 440FX PMC write to PAM register 59 (TLB Flush)00001474149i[P2I  ] PCI IRQ routing: PIRQA# set to 0x0b00001474168i[P2I  ] PCI IRQ routing: PIRQB# set to 0x0900001474187i[P2I  ] PCI IRQ routing: PIRQC# set to 0x0b00001474206i[P2I  ] PCI IRQ routing: PIRQD# set to 0x0900001474216i[P2I  ] write: ELCR2 = 0x0a00001474982i[BIOS ] PIIX3/PIIX4 init: elcr=00 0a00001482642i[BIOS ] PCI: bus=0 devfn=0x00: vendor_id=0x8086 device_id=0x1237 class=0x060000001484907i[BIOS ] PCI: bus=0 devfn=0x08: vendor_id=0x8086 device_id=0x7000 class=0x060100001487011i[BIOS ] PCI: bus=0 devfn=0x09: vendor_id=0x8086 device_id=0x7010 class=0x010100001487243i[PIDE ] new BM-DMA address: 0xc00000001487858i[BIOS ] region 4: 0x0000c00000001489874i[BIOS ] PCI: bus=0 devfn=0x0b: vendor_id=0x8086 device_id=0x7113 class=0x068000001490107i[ACPI ] new irq line = 1100001490119i[ACPI ] new irq line = 900001490148i[ACPI ] new PM base address: 0xb00000001490162i[ACPI ] new SM base address: 0xb10000001490190i[PCI  ] setting SMRAM control register to 0x4a00001654281i[CPU0 ] Enter to System Management Mode00001654291i[CPU0 ] RSM: Resuming from System Management Mode00001818309i[PCI  ] setting SMRAM control register to 0x0a00001827062i[BIOS ] MP table addr=0x000fba00 MPC table addr=0x000fb930 size=0xd000001828801i[BIOS ] SMBIOS table addr=0x000fba1000001831952i[BIOS ] Firmware waking vector 0x1ff00cc00001836891i[BIOS ] ACPI tables: RSDP addr=0x000fbb30 ACPI DATA addr=0x01ff0000 size=0x1f1800001836927i[PCI  ] 440FX PMC write to PAM register 59 (TLB Flush)00001837655i[BIOS ] bios_table_cur_addr: 0x000fbb5400013994287i[FDD  ] attempt to read/write sector 1 with media not present00021976005i[FDD  ] controller reset in software00022030980p[BIOS ] >>PANIC<< No bootable device.========================================================================Event type: PANICDevice: [BIOS ]Message: No bootable device.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 [BIOS ]  die        - stop execution now  abort      - dump core   debug      - hand control to gdb

然后成功的进入了debug阶段,虽然这样没有boot.bin和a.img就这样进入了debug阶段
No bootable device.
指得就是没有软盘吧。。。

把boot.bin和a.img和放在同一文件夹后就能正常运行啦。。。

不过为什么没有PANIC就不会出现debug的选项呢?真的很奇怪诶,一般随便那种语言即使写一个helloworld也是能debug的啊?

对于Ubuntu还是有不能解决的问题啊,关于像书上那样一步一步的制造软盘还是不会啊,只会编写文件,有待下一次blog。