bochs

How can I use Bochs to run Assembly code?

自作多情 提交于 2019-12-03 08:16:26
I want to use Bochs as an 8086 emulator. Is there an easy way to do this? What I want is something like emu8086 ( http://www.emu8086.com/ ). asveikau If the initial part of your program fits in 512 bytes, and you don't mind restricting yourself to BIOS calls, in / out instructions, and writing to magic memory locations for I/O... Then yes! Assuming you're using NASM, here's a goofy example... (Warning: my 16-bit assembly skills are not very great and kind of rusty, so it might not be the best code.) [org 7c00h] ; BIOS will load us to this address mov ax, 0b800h ; Console memory is at 0xb8000;

bochs 调试 com 文件 magicbreak

南楼画角 提交于 2019-12-03 05:08:25
转自 https://blog.csdn.net/housansan/article/details/41833581 在网上看到2中解决此问题的方法: 1.使用dos下的debug32工具单步跟踪pmtest2.com的运行情况。但这个方法存在问题,当跟踪到mov cr0,eax语句时freedos会错误,无法继续跟踪下去。 2.使用bochs的magic_break,方法如下: 在Bochs的配置文件里加上一句magic_break: enabled=1,然后在程序里加上一句xchg bx,bx,运行到这条指令时会断到Bochs调试器里(在Bochsrc_sample.txt里)。 网上的留言的大侠使用该方法成功了,可惜我没成功,网上回了个贴,说了一下自己的操作流程,等待回复中。 今天终于把这个方法实验成功了,前面失败的原因是没有把新编译成的pmtest.com文件拷贝到pm.img文件中。下面把整个步骤完整的列一下: 1)修改bochsrc文件。 在文件末尾增加“magic_break: enabled=1” 2)pmtest.asm文件中增加语句xchg bx, bx,选了2个地方都没有成功 org 0100h ;xchg bx, bx ;我选的位置 jmp LABEL_BEGIN 3)用nasm编译新该的asm文件,并拷贝到pm.img中 sudo mount -o

Compiling Bochs on Mac os x Snow Leopard

若如初见. 提交于 2019-12-03 03:03:00
Was someone able to compile the Bochs simulator under Snow Leopard. Leopard worked fine for me but under Snow Leopard I get alot of problems related to the Carbon library... Ok, some more information was request. I compile with make on the shell; stanard build process coming with the bochs sources I was successfully able to compile against the 10.5 SDK. Unfortunatley, it was not running under Snow Leopard... always crashed then I installed the latest XCode from the SnowLeopard CD and compiled against the 10.6 SDK; withot changing nothing but the isysroot flag to point to the 10.6 instead of 10

int 13h 42h doesn't load anything in Bochs

末鹿安然 提交于 2019-11-27 14:54:41
I changed my bootloader from CHS to LBA, so I replaced int 13h 02h with int 13h 42h . It works correctly in QEMU, however, I have troubles running it with Bochs and my laptop. I wrote bootloader to USB flash drive with dd if=main.bin of=/dev/sdb bs=512 . Laptop loads Intel UNDI and gives me the following error: No bootable device - insert boot disk and press any key . So I tried to debug it with Bochs and noticed that Bochs recognizes this binary file as bootable. However, nothing had been loaded after int 13h executed. Then I tried to load my old PC from this flash drive, and it works! It

Linux 0.11内核编译和bochs上的实验环境的搭建

眉间皱痕 提交于 2019-11-27 06:46:18
最近决定开始阅读Linux 0.11的源代码。 学习Linux操作系统的核心概念最好的方法莫过于阅读源代码。而Linux当前最新的源代码包已经有70MB左右,代码十分庞大,要想深入阅读十分困难。而Linux早期的0.11版本虽然有诸多局限,但是具备了现代操作系统的完备功能,一些基本概念沿用到了当前版本,并且代码只有300KB,非常适合阅读。 阅读源代码之前首先需要搭建实验环境,由于Linux 0.11的代码是二十年前编写的,当前版本的gcc编译器无法正常编译通过,因此需要首先将Linux 0.11源代码移植到gcc 4.3.4+,并在bochs虚拟机上搭建起了实验环境。 一、Linux 0.11内核编译 1、编译环境设置 我的操作系统是: Linux ubuntu 2.6.32-32-generic #62-Ubuntu SMP i686 GNU/Linux 安装gcc编译器,使用gcc -v确认gcc编译器的版本高于4.3.4 安装编译工具: apt-get install build-essential 安装该软件包: apt-get install bin86 2、修改Makefile文件 Linux 0.11内核源代码中基本上每个子目录都包含有一个Makefile,需要对每个Makefile进行如下修改: a)将gas替换为as,将gld替换为ld

int 13h 42h doesn't load anything in Bochs

空扰寡人 提交于 2019-11-26 16:57:31
问题 I changed my bootloader from CHS to LBA, so I replaced int 13h 02h with int 13h 42h . It works correctly in QEMU, however, I have troubles running it with Bochs and my laptop. I wrote bootloader to USB flash drive with dd if=main.bin of=/dev/sdb bs=512 . Laptop loads Intel UNDI and gives me the following error: No bootable device - insert boot disk and press any key . So I tried to debug it with Bochs and noticed that Bochs recognizes this binary file as bootable. However, nothing had been

Enable the boot loader to load the second sector of a USB

巧了我就是萌 提交于 2019-11-26 14:34:36
问题 I am learning the assembly language. I wrote a simple bootloader. After testing it out, it didn't work. Here is my code: [bits 16] [org 0x7c00] jmp start data: wolf_wel_msg db 'Welcome to Bootloader!!!',0x0D,0x0A,0 wolf_kernel_load db 'Loading kernel....',0x0D,0x0A,0 wolf_error_msg db 'Kernel.bin not found!',0x0D,0x0A,0 wolf_error_msg1 db 'Press any key to restart..',0 start: mov si, wolf_wel_msg call wolf_print mov si, wolf_kernel_load call wolf_print pushf stc mov ah,00 mov dl,00 int 13h