Code Monkey home page Code Monkey logo

x86-asm-demo's Introduction

This repo contains the demos in 《x86汇编语言:从实模式到保护模式》, and shows how to run them on Mac with Bochs.

Environment

MacOS Mojave version 10.14.3
MacBook Pro (Retina, 13-inch, Mid 2014)
Processor 2.8 GHz Intel Core i5
Memory 16GB 1600 MHz DDR3
Graphics Intel Iris 1536 MB
NASM version 2.14.02 compiled on Dec 27 2018
Bochs x86 Emulator 2.6.9 (Built from SVN snapshot on April 9, 2017)

Run examples with bochs

Install nasm and bochs.

brew install nasm
brew install bochs

Create a floppy disk and a hard disk with bximage.

bximage
    1. Create new floppy or hard disk image
    2. Convert hard disk image to other format (mode)
    3. Resize hard disk image
    4. Commit 'undoable' redolog to base image
    5. Disk image info
    0. Quit
    Please choose one [0] 1 <return>
  Create image
    Do you want to create a floppy disk image or a hard disk image?
    Please type hd or fd. [hd] fd
  Choose the size of floppy disk image to create.
    Please type 160k, 180k, 320k, 360k, 720k, 1.2M, 1.44M, 1.68M, 1.72M, or 2.88M.
    [1.44M] <return>
  What should be the name of the image?
    [a.img] <return>
bximage
    1. Create new floppy or hard disk image
    2. Convert hard disk image to other format (mode)
    3. Resize hard disk image
    4. Commit 'undoable' redolog to base image
    5. Disk image info
    0. Quit
    Please choose one [0] 1 <return>
  Create image
    Do you want to create a floppy disk image or a hard disk image?
    Please type hd or fd. [hd] <return>
  What kind of image should I create?
    Please type flat, sparse, growing, vpc or vmware4. [flat] <return>
  Enter the hard disk size in megabytes, between 10 and 8257535
    [10] <return>
  What should be the name of the image?
    [c.img] <return>

Check source files and compile them.

vim *.asm compile.sh
./compile.sh

Chech bochs settings and run!

vim bochsrc
./run.sh
  c <return>

x86-asm-demo's People

Contributors

znculee avatar

Stargazers

 avatar Huang Hua avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.