当前位置: 技术问答>linux和unix
求救 为何出现 symbol `DA_C' undefined
来源: 互联网 发布时间:2016-12-11
本文导语: 是一个操作系统的实现的一个例子 我是一个一个代码写过来的阿 检查了也没有错 可是 为何 会出现 pmtest1.asm:9: error: symbol `DA_C' undefined 的错误呢 代码如下: %include "pm.inc" org 07c00h jmp LABEL_BEGIN [SECTION...
是一个操作系统的实现的一个例子 我是一个一个代码写过来的阿 检查了也没有错 可是 为何 会出现 pmtest1.asm:9: error: symbol `DA_C' undefined 的错误呢
代码如下:
%include "pm.inc"
org 07c00h
jmp LABEL_BEGIN
[SECTION .gdt]
LABEL_GDT: Descriptor 0, 0, 0
LABEL_DESC_CODE32: Descriptor 0, SegCode32Len - 1, DA_C + DA_32
LABEL_DESC_VIDEO: Descriptor 0B8000h, 0ffffh, DA_DRW
GdtLen equ $ - LABEL_GDT
GdtPtr dw GdtLen - 1
dd 0
SelectorCode32 equ LABEL_DESC_CODE32 - LABEL_GDT
SelectorVideo equ LABEL_DESC_VIDEO - LABEL_GDT
[SECTION .s16]
[BITS 16]
LABEL_BEGIN:
mov ax, cs
mov ds, ax
mov es, ax
mov ss, ax
mov sp, 0100h
xor eax, eax
mov ax, cs
shl eax, 4
add eax, LABEL_SEG_CODE32
mov word [LABEL_SEG_CODE32 + 2], ax
shr eax, 16
mov byte [LABEL_SEG_CODE32 + 4], al
mov byte [LABEL_SEG_CODE32 + 7], ah
xor eax, eax
mov ax, ds
shl eax, 4
add eax, LABEL_GDT
mov dword [GdtPtr + 2], eax
lgdt [GdtPtr]
cli
in al, 92h
or al, 00000010b
out 92h, al
mov eax, cr0
or eax, 1
mov cr0, eax
jmp dword SelectorCode32:0
[SECTION .s32]
[BITS 32]
LABEL_SEG_CODE32:
mov ax, SelectorVideo
mov gs,ax
mov edi,(80*11+79) * 2
mov ah, 0ch
mov al, 'P'
mov [gs:edi], ax
jmp $
SegCode32Len equ $ - LABEL_SEG_CODE32
pm.inc:
%macro Descriptor 3
;DA_C equ 98h
;DA_DRW equ 92h
dw %2 & 0ffffh
dw %1 & 0ffffh
db (%1 >> 16) & 0ffh
dw ((%2 >> 8) & 0f00h) | (%3 & 0f0ffh)
db (%1 >> 24) & 0ffh
%endmacro
各位牛人 帮帮忙
代码如下:
%include "pm.inc"
org 07c00h
jmp LABEL_BEGIN
[SECTION .gdt]
LABEL_GDT: Descriptor 0, 0, 0
LABEL_DESC_CODE32: Descriptor 0, SegCode32Len - 1, DA_C + DA_32
LABEL_DESC_VIDEO: Descriptor 0B8000h, 0ffffh, DA_DRW
GdtLen equ $ - LABEL_GDT
GdtPtr dw GdtLen - 1
dd 0
SelectorCode32 equ LABEL_DESC_CODE32 - LABEL_GDT
SelectorVideo equ LABEL_DESC_VIDEO - LABEL_GDT
[SECTION .s16]
[BITS 16]
LABEL_BEGIN:
mov ax, cs
mov ds, ax
mov es, ax
mov ss, ax
mov sp, 0100h
xor eax, eax
mov ax, cs
shl eax, 4
add eax, LABEL_SEG_CODE32
mov word [LABEL_SEG_CODE32 + 2], ax
shr eax, 16
mov byte [LABEL_SEG_CODE32 + 4], al
mov byte [LABEL_SEG_CODE32 + 7], ah
xor eax, eax
mov ax, ds
shl eax, 4
add eax, LABEL_GDT
mov dword [GdtPtr + 2], eax
lgdt [GdtPtr]
cli
in al, 92h
or al, 00000010b
out 92h, al
mov eax, cr0
or eax, 1
mov cr0, eax
jmp dword SelectorCode32:0
[SECTION .s32]
[BITS 32]
LABEL_SEG_CODE32:
mov ax, SelectorVideo
mov gs,ax
mov edi,(80*11+79) * 2
mov ah, 0ch
mov al, 'P'
mov [gs:edi], ax
jmp $
SegCode32Len equ $ - LABEL_SEG_CODE32
pm.inc:
%macro Descriptor 3
;DA_C equ 98h
;DA_DRW equ 92h
dw %2 & 0ffffh
dw %1 & 0ffffh
db (%1 >> 16) & 0ffh
dw ((%2 >> 8) & 0f00h) | (%3 & 0f0ffh)
db (%1 >> 24) & 0ffh
%endmacro
各位牛人 帮帮忙
|
pm.inc中把DA_C注释了。
;DA_C equ 98h
;DA_DRW equ 92h
;DA_C equ 98h
;DA_DRW equ 92h
|
好像是
这个是哪本书里的吗?哪本啊?
这个是哪本书里的吗?哪本啊?