Git Product home page Git Product logo

mistos's Introduction

LiveOS

X86 OS

Nasm Note

  • [] , 表示间接寻址,即取出地址的值。
  • ndisasm - o <address> <bin_file> : 反汇编
  • $ : 表示当前代码编译后的二进制代码地址
  • $$: 表示一个section(Nasm 的特殊概念)
  • $-$$:表示当前代码与程序开始处的相对距离
  • times <n> <expr>:表示将语句重复 n 遍

Bochs Note

  • h : 打印帮助信息
  • b <adress> : 设置断点
  • info break : 显示所有断点
  • c : continue ,运行到断点处
  • s : 单步执行, 不进入函数体
  • n : 下一步指令, 进入函数体
  • r : 打印寄存器信息
  • page <address> : 打印地址所在的线性地址和物理地址的映射
  • trace-reg <on/off>: 每次执行都打印寄存器信息
  • trace-mem <on.off> : 每次执行都打印内存信息
  • x : 执行一步指令,显示内存
  • print-stack : 查看堆栈信息
  • xp </nuf> <addr> : 查看物理地址内容。nuf n 表示数字(十进制,表示查看的大小), u表示 输出的显示进制(x,d,u,o,t,c,s,i 分别表示 hex, decimal, unsigned, octal, binary, char, asciiz, instr), f 表示单位(b,h,w,g , 表示byte, half-word(即字节), word and giant word)
  • x </nuf> <addr> : 查看线性地址的内容, 格式同上
  • u <start_addr> <end_addr> : 反汇编一段内存
  • trace on : 反汇编执行的每一条指令

编码规范

  • 主逻辑放到上面,数据放到下面
  • 常量命名EQU, 所有字母大写,下划线隔开, NASM_COMPILER
  • 描述符命名,DESC_VIDEO
  • 选择子命名, SELECTOR_VIDEO
  • 循环标签命名,loop_read_sector
  • 段名(SECTION)boot32, 它的第一个位置必须放标签,SEG_BOOT32
  • 例程命名,小驼峰,readHardDisk0, print, readFloppy
  • 结构宏命名,Descriptor, PageItem
  • 结构实体,gdtr, 结构实体和地址标签的区别在于使用时是否使用【】访问内存

Qemu Note

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.