avatar
Articles
255
Tags
100
Categories
23

Theqiqi_blog
Search

Theqiqi_blog

4.使用机器码编写bios引导的程序
Created2025-03-25|OperatingSystem|assembly•gcc•Linux•OperatingSystem•Vmware
使用二进制编辑器手动编写 bootloader直接用二进制编辑器写机器码来实现 bootloader 是完全可行的(早期操作系统开发常用此方法)。核心是 手动写出每条指令对应的机器码,并保证启动扇区规范:512 字节 + 结尾 0xAA55。 一、核心原理:指令 → 机器码对应关系x86 16 位实模式指令有固定机器码格式,例如: 指令 机器码 说明 mov ah, 0x0e b4 0e BIOS 打印功能 mov al, 'H' b0 48 ‘H’ 的 ASCII 码 0x48 int 0x10 cd 10 BIOS 视频中断 jmp loop(无限循环) eb fe 相对偏移 0xfe 跳转自身 二、用二进制编辑器编写步骤(以打印 "Hi" 为例)1. 确定指令与机器码打印 'H' → 打印 'i' → 无限循环,对应机器码序列: 123456b4 0e ; mov ah, 0x0eb0 48 ; mov al, 'H'cd 10 ; int 0 ...
3.使用 ndisasm 反汇编 boot.bin
Created2025-03-25|OperatingSystem|assembly•gcc•Linux•OperatingSystem•Vmware
使用 ndisasm 反汇编 boot.binndisasm 是 NASM 自带的反汇编工具,非常适合 16 位实模式代码,输出接近 Intel 语法,更易于与源码对照。 一、反汇编命令1ndisasm -b 16 boot.bin -b 16:指定 16 位模式 boot.bin:目标二进制文件(纯启动扇区) 二、反汇编结果示例以打印 "Hi" 的 bootloader 为例: 1234567891000000000 B40E mov ah,0Eh00000002 B048 mov al,'H'00000004 CD10 int 10h00000006 B069 mov al,'i'00000008 CD10 int 10h0000000A EBFE jmp 0Ah ; 无限循环0000000C 0000 a ...
2.在 Linux 中使用系统自带工具反汇编 boot引导程序
Created2025-03-25|OperatingSystem|assembly•gcc•Linux•OperatingSystem•Vmware
在 Linux 中反汇编 boot.bin(16 位启动扇区)boot.bin 是纯二进制格式(无 ELF 头)的 16 位 bootloader,因此反汇编时需要手动指定架构与格式。Linux 自带的 objdump 就能完成。 一、反汇编命令对于 x86 16 位 bootloader: 1objdump -D -b binary -m i8086 boot.bin 参数说明 -D:反汇编全部内容(纯二进制无段信息,只能全部解析) -b binary:指定输入为原始二进制文件 -m i8086:指定反汇编架构为 Intel 8086(16 位实模式) 二、反汇编结果解析以打印 “Hi” 的启动扇区为例,常见结果如下(只截取核心部分): 123456789101112131415boot.bin: file format binaryDisassembly of section .data:00000000 <.data>: 0: b4 0e mov $0xe,%ah 2: b0 48 ...
1.使用系统自带的as+objcopy+dd+VMware完成bios引导程序
Created2025-03-25|OperatingSystem|assembly•gcc•Linux•OperatingSystem•Vmware
1. 编写代码12345678910111213141516.code16 # 声明 16 位模式(实模式).global _start_start: mov $0x0e, %ah # BIOS 功能:打印字符 mov $'H', %al # 字符 'H' int $0x10 # 调用 BIOS 中断 mov $'i', %al # 字符 'i' int $0x10loop: jmp loop # 无限循环.fill 510 - (. - _start), 1, 0 # 填充到 510 字节.word 0xaa55 # 启动标志 2. 使用 GNU as 将汇编代码转为二进制文件如果系统只有 as(AT&T 语法)并使用 VMware 测试,也可以制作简易 bootloader。 as 默认 ...
0.用nasm编写一个boot程序打印hellworld
Created2025-03-25|OperatingSystem|assembly•nasm•first pragram•OperatingSystem•qemu
Bootlaoder1. 使用汇编语言编写一个二进制程序,显示HelloWorld1. 编写asm.asmasm.asm 1234567891011121314151617181920212223242526272829303132333435[BITS 16][ORG 0x7c00]start: cli ;Clear interrupts mov ax, 0x00 mov ds, ax mov es, ax mov ss, ax mov sp,0x7c00 sti ; Enable interrupts mov si, msgprint : lodsb ; Loads byte at ds:si to AL register and incremens SI cmp al, 0 je done mov ah, 0x0E int 0x10 jmp printdone: cli hlt ; Stop further CPU executionmsg: db 'Hello World! ...
37.添加图片资源
Created2025-03-24|QT6_Gui|C++•Qt6•Cmake•GUI
添加图片1. 第一步:创建资源文件 (res.qrc)在你的项目根目录下(和 CMakeLists.txt 同级),手动创建一个名为 res.qrc 的文本文件,内容如下: 1234567<!DOCTYPE RCC><RCC version="1.0"><qresource prefix="/"> <file>icons/new.png</file> <file>icons/open.png</file> <file>icons/save.png</file> </qresource></RCC> 2. 第二步:在 CMakeLists.txt 中配置你需要告诉 CMake 处理这个资源文件。核心命令是开启 AUTORCC。 123456789101112131415# 1. 必须开启自动资源处理set(CMAKE_AUTORCC ON)# 2. 找到你的资源文件set(RESOURCES ...
36.QPushButton
Created2025-03-24|QT6_Gui|C++•Qt6•Cmake•GUI
QPushButtonmain.cpp1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162#include <QApplication>#include <QWidget>#include <QPushButton>#include <QVBoxLayout>#include <QMenu>#include <QShortcut>#include <QDebug>#include <qstyle.h>void setupButtonDemo(QWidget *parent) { QVBoxLayout *layout = new QVBoxLayout(parent); // --- 1. 基础按钮 --- QPushButton *normalBtn = new QPushButton( ...
35.QRadioButton
Created2025-03-24|QT6_Gui|C++•Qt6•Cmake•GUI
QRadioButtonmain.cpp12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970#include <QApplication>#include <QWidget>#include <QRadioButton>#include <QGroupBox>#include <QVBoxLayout>#include <QHBoxLayout>#include <QLabel>#include <QDebug>void setupRadioButtonDemo(QWidget *parent) { QVBoxLayout *mainLayout = new QVBoxLayout(parent); // --- 1. 性别选择组 (QGroupBox 实现逻辑分 ...
34.QCheckBox
Created2025-03-24|QT6_Gui|C++•Qt6•Cmake•GUI
QCheckBoxmain.cpp1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859#include <QApplication>#include <QWidget>#include <QCheckBox>#include <QVBoxLayout>#include <QLabel>#include <QPushButton>#include <QDebug>void setupCheckBoxDemo(QWidget *parent) { QVBoxLayout *layout = new QVBoxLayout(parent); // --- 1. 基础用法:开关控制 --- QCheckBox *agreeCheck = new QCheckBox("我已阅读并同意服务协议", par ...
33.QToolButton
Created2025-03-24|QT6_Gui|C++•Qt6•Cmake•GUI
QToolButtonmain.cpp1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768#include <QApplication>#include <QWidget>#include <QToolButton>#include <QVBoxLayout>#include <QHBoxLayout>#include <QMenu>#include <QStyle>#include <QDebug>void setupToolButtonDemo(QWidget *parent) { QVBoxLayout *mainLayout = new QVBoxLayout(parent); QHBoxLayout *rowLayout = new QHBoxLayout(); ...
123…26
avatar
Theqiqi
Articles
255
Tags
100
Categories
23
Follow Me
Announcement
This is my Blog
Recent Post
101.使用Grop网站提供的api2026-01-03
9.压测2025-03-27
8.Linux Socket并发模型http服务器2025-03-27
7.web服务器中收发REST接口2025-03-27
6使用c语言与linux系统写一个web服务器,解析并响应get与post请求2025-03-27
Categories
  • C with Socks16
  • C_Sound10
  • C_Windows_Graphi9
  • Cpp5
  • Cpp_Socket4
  • C语言在Windows中实现抓包4
  • C语言的万种用法9
  • Debian1
Tags
Cmake UltraISO AI rufus C GDI Windows web UDP termux poll mysql BSD Sockets x86汇编程序 ISO html Vmware Socks5 Drvier Compile qemu DLL ipv6 Hook TCP 64位汇编程序 Http PVE Qt linux first pragram OpenGl make android Ipv6 python Debian Websocket Graphi Desktop
Archives
  • January 20261
  • March 202596
  • February 202523
  • September 20242
  • August 202471
  • June 20242
  • March 202411
  • February 20248
Info
Article :
255
UV :
PV :
Last Update :
©2020 - 2026 By Theqiqi
Framework Hexo|Theme Butterfly
Search
Loading the Database