`
lobin
  • 浏览: 383286 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论
阅读更多

 

写道
还有个Boot Manager,这个也比较重要,单独开篇分章节讲。这里给个引用的链接地址。

 

 

 

 

 

 

 

声卡

 

电源管理

ACPI

ACPI即Advanced Configuration and Power Interface,高级配置和电源接口

 

RSDP

RSDP即Root System Description Pointer

 

RSDT

RSDT即Root System Description Table

 

XSDT

XSDT即eXtended System Description Table

只有ACPI 2.0及以后的版本才存在XSDT

 

FADT

FADT即Fixed ACPI Description Table

 

文件

 

可执行文件

不同系统的可执行文件格式是不一样的。比较常见的是windows下的exe文件,即PE格式,还有linux下的ELF格式。除了我们常见的程序这种可执行文件,还有其他的可执行文件,如Windows的.com,.sys以及linux下的binary等。甚至windows下的.dll, .lib以及linux下的.so, .a等链接库文件也是可执行文件。

 

格式

binary

以下面一个简单的binary文件为例,源代码如下:

	.code16
	.global _start
	.text
	
_start: 
	mov %cs, %ax
	mov %ax, %ds
	mov $message, %dx

	mov $0x09, %ah
	int $0x21

	mov $0x4c, %ah
	int $0x21

message:
	.ascii "Hello, MASM!"
	.byte 0x0d, 0x0a, '$'

编译成binary可执行文件后,内容如下:

 

8C C8 8E D8 BA 0F 01 B4  09 CD 21 B4 4C CD 21 48

65 6C 6C 6F 2C 20 4D 41  53 4D 21 0D 0A 24 

 

 

COM

COM文件是windows下的一种可执行文件。和EXE可执行程序文件不同的是,COM文件是一种纯二进制可执行程序文件,文件中仅仅包含直接执行的机器码,没有EXE可执行文件那么复杂的格式定义。

 

以下面一个简单的COM文件为例,源代码如下:

CODE SEGMENT
	ORG 100H
START:
	MOV AX, CS
	MOV DS, AX
	MOV DX, OFFSET MESSAGE	; 字符串首偏移地址放到DX中
	MOV AH, 9
	INT 21H			; 输出字符串

	MOV AH, 4CH
	INT 21H

MESSAGE:
	DB 'Hello, MASM!', 0DH, 0AH, '$'
CODE ENDS
	END START

 

编译成COM可执行文件后,内容如下:

8C C8 8E D8 BA 0F 01 B4  09 CD 21 B4 4C CD 21 48

65 6C 6C 6F 2C 20 4D 41  53 4D 21 0D 0A 24 

 

从上面binary和com可执行文件内容可知,它们是一样的。
获取命令行传入的参数
CODE SEGMENT
	ORG 100H
START:
	MOV AX, CS
	MOV DS, AX
	MOV DX, OFFSET MESSAGE	; 字符串首偏移地址放到DX中
	MOV AH, 9
	INT 21H			; 输出字符串

	MOV SI, 0080H		; 从这里开始读取参数信息
	MOV CL, ES:[SI]		; 读取参数信息长度
	INC SI			; 从这里开始读取参数字符串
PRINT_ARGS:	
	CMP CL, 0
	JE  EXIT

	MOV AL, ES:[SI]
	MOV AH, 0EH
	MOV BX, 0FH
	INT 10H

	INC SI
	DEC CL
	JMP PRINT_ARGS
EXIT:
	MOV AH, 4CH
	INT 21H

MESSAGE:
	DB 'Hello, MASM!', 0DH, 0AH, '$'
CODE ENDS
	END START
>.\com_test_1.com 123 456 789 012 345 678 901 234 567 890 123 456 789 012 345 678 901
Hello, MASM!
 123 456 789 012 345 678 901 234 567 890 123 456 789 012 345 678 901 
 

汇编加载COM程序并执行:

	u_code_seg	equ 8c00h
	u_code_offset	equ 0100h

data segment
	filename	db 'com_test.com', 0, '$'
	file_suffix	db '.com'
	

	file_open_ok	db 'file open success!', 0dh, 0ah, '$'
	file_open_error db 'file open error!', 0dh, 0ah, '$'

	file_read_error db 'file read error!', 0dh, 0ah, '$'

	program_load_ok db 'program loaded!', 0dh, 0ah, '$'
	program_start	db 'start...', 0dh, 0ah, '$'
	program_end	db 'end.', 0dh, 0ah, '$'
data ends

bss segment
	file_handle	dw ?
bss ends

code segment
start:
	mov ax, data
	mov ds, ax

	mov ax, bss
	mov es, ax

	mov dx, offset filename

	mov ah, 09h
	int 21h

	; open file
	mov ah, 3dh
	mov al, 00h	; read mode
	int 21h

	jnc label_file_open_ok

	mov ah, 09h
	mov dx, offset file_open_error
	int 21h

	jmp exit

label_file_open_ok:
	mov es:file_handle, ax	; if opened, read file handle from ax. ax = file handle

	mov ah, 09h
	mov dx, offset file_open_ok
	int 21h


	; read file

	; load into u_code_seg:u_code_offset. u_code_seg = 8c00h, u_code_offset = 0000h
	; 
	; ds:dx = u_code_seg:u_code_offset. u_code_seg = 8c00h, u_code_offset = 0000h
	mov dx, u_code_seg
	mov ds, dx
	mov dx, u_code_offset

label_read:
	mov ah, 3fh
	mov bx, es:file_handle	; file handle
	mov cx, 08h		; 8 bytes. read 8 bytes per one times
	int 21h

	jnc label_read_ok

	mov ah, 09h
	mov dx, offset file_read_error
	int 21h

	jmp exit

label_read_ok:
	cmp ax, 0	; reach eof
	je  u_start
	
	add dx, ax
	jmp label_read
u_start:
	mov dx, data
	mov ds, dx

	mov ah, 09h
	mov dx, offset program_load_ok
	int 21h

	mov ah, 09h
	mov dx, offset program_start
	int 21h

	;jmp u_code_seg:u_code_offset. u_code_seg = 8c00h, u_code_offset = 0000h
	db	0eah		; jmp far
	dw	u_code_offset	; offset
	dw	u_code_seg	; segment
	
	mov ah, 09h
	mov dx, offset program_end
	int 21h
exit:
	mov ah, 4ch
	int 21h
code ends
	end start



 

 

EXE

关于EXE,参考另一篇:https://www.iteye.com/blog/lobin-2513749

 

PE

关于PE,参考另一篇:https://www.iteye.com/blog/lobin-2326260

 

获取命令行传入的参数

DATA SEGMENT
	MESSAGE DB 'HELLO, THIS IS MASM!', 0DH, 0AH, '$'
DATA ENDS

CODE SEGMENT
	ASSUME CS:CODE, DS:DATA
START:
	MOV AX, DATA
	MOV DS, AX
	MOV DX, OFFSET MESSAGE	; 字符串首偏移地址放到DX中
	MOV AH, 9
	INT 21H			; 输出字符串

	MOV SI, 0080H		; 从这里开始读取参数信息
	MOV CL, ES:[SI]		; 读取参数信息长度
	INC SI			; 从这里开始读取参数字符串
PRINT_ARGS:	
	CMP CL, 0
	JE  EXIT

	MOV AL, ES:[SI]
	MOV AH, 0EH
	MOV BX, 0FH
	INT 10H

	INC SI
	DEC CL
	JMP PRINT_ARGS
EXIT:
	MOV AH, 4CH
	INT 21H
CODE ENDS
	END START

>.\exe_test_1.exe 123 456 789 012 345 678 901 234 567 890 123 456 789 012 345 678 901

HELLO, THIS IS MASM!

 123 456 789 012 345 678 901 234 567 890 123 456 789 012 345 678 901

 

 

ELF

# ldd /usr/bin/gcc

linux-gate.so.1 =>  (0x006d3000)

libc.so.6 => /lib/libc.so.6 (0x00834000)

/lib/ld-linux.so.2 (0x80075000)

 

# ldd /lib/libc.so.6 

/lib/ld-linux.so.2 (0x8000e000)

linux-gate.so.1 =>  (0x002dd000)

 

# ldd /lib/ld-linux.so.2 

statically linked

 

C运行环境

 

C标准库 

 

链接

链接通常指的是我们的动态链接,比如我们的那些动态链接库,对应的文件就是动态链接文件,比如我们常见的那些dll文件,linux下的那些so文件。

 

动态链接

 

静态链接

除了上面的动态链接,其实还有一种静态链接。静态链接我们首先想到的就是那些静态链接库,对应的文件就是静态链接文件,像我们常见的那些lib文件,linux下的那些a文件。

 

另外在linux下还有一种静态链接,像上面的,linux下的程序,我们在查看他们依赖的链接库的时候,发现有个ld-linux.so的链接,这个看着是so,但我们却找不到对应的文件,其实这个文件是不存在的,它其实是链接到内核地址空间中的一段程序。这也是一种特殊的静态链接。

 

图形引擎

 

设备坐标系统

写道
(0,0)
+--------------------------------------------------+--->x
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
+--------------------------------------------------+
|
|
|
v
y

 

 

图形界面

 

写道

-
top border ^
top left corner | top right corner |
| v | |
| ___________________ | title bar
+---> / \ <---+ |
| | |
v
- -
top border ^
| |
v |
+-------------------+ |
| | |
left border --->| | <--- right border window box
| | |
| | |
+-------------------+ |
^ |
| |
bottom border v
-

 

 

写道

+-----+
| |
| |<-------- parent
+-----+ \
/ | \ \
/ | .. \ \
/ | \ \
/ | \ \
+-----+ +-----+ +-----+ \
| | | | .. | |----\
| | | | | |<-------- parent
+-----+ +-----+ +-----+ \
/ | \ \ \
/ | .. \ . \ \
/ | \ . \ \
/ | \ \ \
+-----+ +-----+ +-----+ +-----+ \
| | | | .. | | | |----\
| | | | | | | |<-------- parent
+-----+ +-----+ +-----+ +-----+ \
/ | \ / \ \
/ | .. \ / \ \
/ | \ / \ \
/ | \ / \ \
+-----+ +-----+ +-----+ +-----+ +-----+ \
| | | | .. | | | | | |----\
| | | | | | | | | |
+-----+ +-----+ +-----+ +-----+ +-----+

 

 

 

窗口系统

 

写道
___________________ ___________________
/ \ / \
| | | |
+-------------------+ +-------------------+
| | | ___________________
| | | / | \
| | | | | |
| | | +-------------------+
+-------------------+ +-----------|-------+ |
_____|_____________ |
/ | \ |
| | | |
+-----+-------------------+
| |
| |
__________________ |
/ | \ |
| +-------|-----------+
+------------------+
| |
| |
| |
| |
+------------------+

 

 

镜像文件制作

可以使用dd或bximage工具制作镜像文件。dd工具更强大。

 

制作一张空的镜像

一张空的镜像文件其实就是一张指定大小的内容全部都是0的二进制文件。



 

 

通过bximage制作一张空的镜像:

>bximage

======================================================================

==

                                bximage

  Disk Image Creation / Conversion / Resize and Commit Tool for Bochs

         $Id: bximage.cc 12690 2015-03-20 18:01:52Z vruppert $

======================================================================

==

 

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

 

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, in megabytes.

Please type 160k, 180k, 320k, 360k, 720k, 1.2M, 1.44M, 1.68M, 1.72M, o

r 2.88M.

 [1.44M] 160k

 

What should be the name of the image?

[a.img] image.img

 

Creating floppy image 'image.img' with 320 sectors

 

The following line should appear in your bochsrc:

  floppya: image="image.img", status=inserted

(The line is stored in your windows clipboard, use CTRL-V to paste)

 

Press any key to continue

 

>bximage

======================================================================

==

                                bximage

  Disk Image Creation / Conversion / Resize and Commit Tool for Bochs

         $Id: bximage.cc 12690 2015-03-20 18:01:52Z vruppert $

======================================================================

==

 

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

 

Create image

 

Do you want to create a floppy disk image or a hard disk image?

Please type hd or fd. [hd] hd

 

What kind of image should I create?

Please type flat, sparse, growing, vpc or vmware4. [flat] flat

 

Enter the hard disk size in megabytes, between 10 and 8257535

[10] 10

 

What should be the name of the image?

[c.img] disk.img

 

Creating hard disk image 'disk.img' with CHS=20/16/63

 

The following line should appear in your bochsrc:

  ata0-master: type=disk, path="disk.img", mode=flat

(The line is stored in your windows clipboard, use CTRL-V to paste)

 

Press any key to continue

通过dd工具制作一张空的镜像:

$ dd if=/dev/zero of=image bs=128c count=1

 

 

QEMU

QEMU安装参考另一篇文章:https://lobin.iteye.com/admin/blogs/609813。这是一篇之前在arm架构上安装时记录的一次QEMU安装经历。

 

下载

# wget --no-check-certificate https://download.qemu.org/qemu-2.1.2.tar.bz2

# tar -jxvf qemu-2.1.2.tar.bz2

 

安装

安装SDL

# yum install SDL-devel

如果没有安装SDL, 在运行qemu时会显示如下信息:

# qemu-system-i386 -boot order=a -fda /dev/loop0

VNC server running on `::1:5900'

 

# mkdir -p /usr/local/qemu-2.1.2-1

 

之前安装时指定了--target-list=arm-softmmu,这次没有指定,这样将安装qemu支持的所有的架构和设备。这样安装起来会比较慢。如果想支持多种架构,可以在--target-list选项后面指定多个,每个之间用逗号分隔,如下:

# ./configure --prefix=/usr/local/qemu-2.1.2 --target-list=arm-softmmu,i386-softmmu,x86_64-softmmu --audio-drv-list=

 

 

# ./configure --prefix=/usr/local/qemu-2.1.2-1 --audio-drv-list=

Install prefix    /usr/local/qemu-2.1.2-1

BIOS directory    /usr/local/qemu-2.1.2-1/share/qemu

binary directory  /usr/local/qemu-2.1.2-1/bin

library directory /usr/local/qemu-2.1.2-1/lib

module directory  /usr/local/qemu-2.1.2-1/lib/qemu

libexec directory /usr/local/qemu-2.1.2-1/libexec

include directory /usr/local/qemu-2.1.2-1/include

config directory  /usr/local/qemu-2.1.2-1/etc

local state directory   /usr/local/qemu-2.1.2-1/var

Manual directory  /usr/local/qemu-2.1.2-1/share/man

ELF interp prefix /usr/gnemul/qemu-%M

Source path       /home/root/packages/qemu-2.1.2

C compiler        cc

Host C compiler   cc

C++ compiler      c++

Objective-C compiler cc

ARFLAGS           rv

CFLAGS            -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include   -g 

QEMU_CFLAGS       -fPIE -DPIE -m32 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wall -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common  -Wendif-labels -Wmissing-include-dirs -Wempty-body -Wnested-externs -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wold-style-declaration -Wold-style-definition -Wtype-limits -fstack-protector-all -I$(SRC_PATH)/pixman/pixman -I$(BUILD_DIR)/pixman/pixman -I$(SRC_PATH)/dtc/libfdt

LDFLAGS           -Wl,--warn-common -Wl,-z,relro -Wl,-z,now -pie -m32 -g 

make              make

install           install

python            python -B

smbd              /usr/sbin/smbd

module support    no

host CPU          i386

host big endian   no

target list        aarch64-softmmu alpha-softmmu arm-softmmu cris-softmmu i386-softmmu lm32-softmmu m68k-softmmu microblazeel-softmmu microblaze-softmmu mips64el-softmmu mips64-softmmu mipsel-softmmu mips-softmmu moxie-softmmu or32-softmmu ppc64-softmmu ppcemb-softmmu ppc-softmmu s390x-softmmu sh4eb-softmmu sh4-softmmu sparc64-softmmu sparc-softmmu unicore32-softmmu x86_64-softmmu xtensaeb-softmmu xtensa-softmmu aarch64-linux-user alpha-linux-user armeb-linux-user arm-linux-user cris-linux-user i386-linux-user m68k-linux-user microblazeel-linux-user microblaze-linux-user mips64el-linux-user mips64-linux-user mipsel-linux-user mips-linux-user mipsn32el-linux-user mipsn32-linux-user or32-linux-user ppc64abi32-linux-user ppc64le-linux-user ppc64-linux-user ppc-linux-user s390x-linux-user sh4eb-linux-user sh4-linux-user sparc32plus-linux-user sparc64-linux-user sparc-linux-user unicore32-linux-user x86_64-linux-user

tcg debug enabled no

gprof enabled     no

sparse enabled    no

strip binaries    yes

profiler          no

static build      no

pixman            internal

SDL support       no

GTK support       no

VTE support       no

curses support    no

curl support      no

mingw32 support   no

Audio drivers     

Block whitelist (rw) 

Block whitelist (ro) 

VirtFS support    no

VNC support       yes

VNC TLS support   no

VNC SASL support  no

VNC JPEG support  no

VNC PNG support   no

VNC WS support    no

xen support       no

brlapi support    no

bluez  support    no

Documentation     no

GUEST_BASE        yes

PIE               yes

vde support       no

netmap support    no

Linux AIO support no

ATTR/XATTR support yes

Install blobs     yes

KVM support       yes

RDMA support      no

TCG interpreter   no

fdt support       yes

preadv support    yes

fdatasync         yes

madvise           yes

posix_madvise     yes

sigev_thread_id   yes

uuid support      no

libcap-ng support no

vhost-net support yes

vhost-scsi support yes

Trace backends    nop

spice support     no

rbd support       no

xfsctl support    no

nss used          no

libusb            no

usb net redir     no

GLX support       no

libiscsi support  no

libnfs support    no

build guest agent yes

QGA VSS support   no

seccomp support   no

coroutine backend ucontext

coroutine pool    yes

GlusterFS support no

virtio-blk-data-plane no

gcov              gcov

gcov enabled      no

TPM support       yes

libssh2 support   no

TPM passthrough   yes

QOM debugging     yes

vhdx              no

Quorum            no

lzo support       no

snappy support    no

NUMA host support no

 

# make 

# make install

 

到这里就安装完了。

 

在之前的安装的时候,我们只针对arm架构的平台:

# ls /usr/local/qemu-2.1.2/bin/

qemu-ga  qemu-img  qemu-io  qemu-nbd  qemu-system-arm

所以这里除了几个工具, 就只有一个qemu-system-arm。

 

这次我们全部安装了:

# ls /usr/local/qemu-2.1.2-1/bin/

qemu-aarch64       qemu-mips        qemu-s390x           qemu-system-m68k          qemu-system-s390x

qemu-alpha         qemu-mips64      qemu-sh4             qemu-system-microblaze    qemu-system-sh4

qemu-arm           qemu-mips64el    qemu-sh4eb           qemu-system-microblazeel  qemu-system-sh4eb

qemu-armeb         qemu-mipsel      qemu-sparc           qemu-system-mips          qemu-system-sparc

qemu-cris          qemu-mipsn32     qemu-sparc32plus     qemu-system-mips64        qemu-system-sparc64

qemu-ga            qemu-mipsn32el   qemu-sparc64         qemu-system-mips64el      qemu-system-unicore32

qemu-i386          qemu-nbd         qemu-system-aarch64  qemu-system-mipsel        qemu-system-x86_64

qemu-img           qemu-or32        qemu-system-alpha    qemu-system-moxie         qemu-system-xtensa

qemu-io            qemu-ppc         qemu-system-arm      qemu-system-or32          qemu-system-xtensaeb

qemu-m68k          qemu-ppc64       qemu-system-cris     qemu-system-ppc           qemu-unicore32

qemu-microblaze    qemu-ppc64abi32  qemu-system-i386     qemu-system-ppc64         qemu-x86_64

 

qemu-microblazeel  qemu-ppc64le     qemu-system-lm32     qemu-system-ppcemb

里边包含了所有。

 

添加到PATH:

# vi ~/.bash_profile

 

PATH=$PATH:$HOME/bin:/usr/local/arm-none-linux-gnueabi/bin:/usr/local/qemu-2.1.2/bin:/usr/local/qemu-2.1.2-1/bin

 

# source ~/.bash_profile

# which qemu-system-arm

/usr/local/qemu-2.1.2/bin/qemu-system-arm

这里可以看到qemu-system-arm找到的是之前安装的。

 

# which qemu-system-i386

 

/usr/local/qemu-2.1.2-1/bin/qemu-system-i386

qemu-system-i386是这次安装的,这里可以看到qemu-system-i386找到的也是我们这次安装的。

 

通过QEMU运行调试主引导程序的例子

以下面的一个Bootloader为例:

#define BOOTSEG 0x07c0

	.code16
	.section .bstext, "ax"
	.global boot_start

boot_start:

	# Normalize the start address
	ljmp	$BOOTSEG, $start

start:
	movw	%cs, %ax
	movw	%ax, %ds
	movw	%ax, %es
	movw	%ax, %ss
	xorw	%sp, %sp

	sti

	movw	$message, %si
	cld

message_loop:
	lodsb
	andb	%al, %al
	jz	wait
	movb	$0xe, %ah
	movw	$7, %bx
	int	$0x10
	jmp	message_loop

wait:
	# Press a key to continue
	xorw	%ax, %ax
	int	$0x16

	# Reboot. int 0x19 should never return.
	int	$0x19

	# jmp to bios...
	ljmp	$0xf000, $0xfff0
    
message:
	.ascii "loading...\r\n"
	.ascii "\r\n"
	.ascii "Welcome!\r\n"
	.ascii "X2\r\n"
	.ascii "version: 1.0.0 2010-02-14 Express Edition\r\n"
	.ascii "(c) Next G\r\n"
	.ascii "\n"
	.byte 0
  
	.org 510
	.word 0xaa55

链接脚本:

OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
OUTPUT_ARCH(i386)
ENTRY(boot_start)

SECTIONS
{
    . = 0;
    .boot : {*(.bstext)}
    . = ASSERT(. <= 512, "boot loader too big! it must be 512 bytes.");
}

 

编译链接:

gcc -E boot_test_3.S -o boot_test_3.asm

as -gstabs boot_test_3.asm -o boot_test_3.o

ld -T boot_test_3.ld boot_test_3.o -o boot_test_3

 

生成镜像并挂载:

生成镜像并挂载到/dev/loop0

dd if=/dev/zero of=boot_test_3.S.img bs=512 count=2880

losetup /dev/loop0 boot_test_3.S.img

losetup -a

objdump -h boot_test_3

dd if=boot_test_3 ibs=512 skip=8 of=/dev/loop0 obs=512 seek=0 count=1

 

运行主引导程序:

# qemu-system-i386 -boot order=a -fda /dev/loop0 -vnc :1

 

通过vnc viewer连接vnc server看结果:





调试主引导程序:
# qemu-system-i386 -s -S -boot order=a -fda /dev/loop0 -vnc :1

 

# gdb -q

(gdb) target remote :1234

Remote debugging using :1234

0x0000fff0 in ?? ()

(gdb) set architecture i8086

The target architecture is assumed to be i8086

(gdb) info reg $cs $pc

cs             0xf00061440

pc: 0xfff0

(gdb) display /5i $cs * 0x10 + $pc

1: x/5i $cs * 0x10 + $pc

   0xffff0:ljmp   $0xf000,$0xe05b

   0xffff5:xor    %dh,0x322f

   0xffff9:xor    (%bx),%bp

   0xffffb:cmp    %di,(%bx,%di)

   0xffffd:add    %bh,%ah

(gdb) b * 0x7c00

Breakpoint 1 at 0x7c00

(gdb) c

Continuing.

 

Breakpoint 1, 0x00007c00 in ?? ()

1: x/5i $cs * 0x10 + $pc

=> 0x7c00:ljmp   $0x7c0,$0x5

   0x7c05:mov    %cs,%ax

   0x7c07:mov    %ax,%ds

   0x7c09:mov    %ax,%es

   0x7c0b:mov    %ax,%ss

(gdb) nexti

0x00000005 in ?? ()

1: x/5i $cs * 0x10 + $pc

   0x7c05:mov    %cs,%ax

   0x7c07:mov    %ax,%ds

   0x7c09:mov    %ax,%es

   0x7c0b:mov    %ax,%ss

   0x7c0d:xor    %sp,%sp

(gdb) c

Continuing.

 

 

同样可以通过vnc viewer连接vnc server看结果

 

删除挂载点:

losetup -d /dev/loop0

 

其他操作系统

 

高性能计算

 

超级计算机

 

量子计算

 

存储设备

 

交换机

 

路由器

 

接入设备

 

嵌入式设备

 

车载设备系统

 

工业系统

 

 

 

有关汇编(整理)可参考另一篇文章:https://www.iteye.com/blog/lobin-2442219

有关AS汇编(整理)可参考另一篇文章:https://www.iteye.com/blog/lobin-2038160

有关386可参考另一篇文章:https://www.iteye.com/blog/lobin-2026860

  • 大小: 12.7 KB
  • 大小: 1.9 KB
  • 大小: 11.2 KB
  • 大小: 3.6 KB
  • 大小: 2.7 KB
  • 大小: 24.5 KB
  • 大小: 12.5 KB
  • 大小: 25.5 KB
  • 大小: 14.8 KB
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics