2016-12-12 1 views
1

간단한 OS를 작성 중이며 emu8086에서 부트 로더와 커널을 작성한 후 플로피 섹터에 씁니다. emu에서 플로피 드라이브로 부팅하면 모든 것이 정상적으로 작동하지만 플로피에서 가상 박스로 부팅 할 때 작동을 할 수 없습니다. 다음 명령은 시스템의 날짜와 시간을 가져 예를 들어커널은 emu8086에서 작동하지만 플로피 컨트롤러가있는 가상 박스에서는 작동하지 않습니다.

: 에뮤에서

infoCommand: 
lea si, info_msg 
call printString 

;Day Part 
mov ah, 2Ah ; To get System Date 
int 21h 
mov al, dl ; Day is in DL 
aam 
mov bx, ax 
call disp 

mov dl, '/' 
mov ah, 02h ; To Print/in DOS 
int 21h 

;Month Part 
mov ah, 2Ah ; To get System Date 
int 21h 
mov al, dh  ; Month is in DH 
aam 
mov bx, ax 
call disp 

mov dl, '/' 
mov ah,02h ; To Print/in DOS 
int 21h 

;Year Part 
mov ah, 2Ah ; To get System Date 
int 21h 
add cx, 0F830h ; To negate the effects of 16bit value, 
mov ax, cx  ; since AAM is applicable only for AL (YYYY -> YY) 
aam 
mov bx, ax 
call disp  

mov dl, ' ' 
mov ah,02h ; To Print '' in DOS 
int 21h 

;Hour Part 
mov ah, 2Ch ; To get System Time 
int 21h 
mov al, ch  ; Hour is in CH 
aam 
mov bx,ax 
call disp 

mov dl, ':' 
mov ah,02h ; To Print : in DOS 
int 21h 

;Minutes Part 
mov ah, 2Ch ; To get System Time 
int 21h 
mov al, cl  ; Minutes is in CL 
aam 
mov bx, ax 
call disp 

mov dl, ':' 
mov ah,02h ; To Print : in DOS 
int 21h 

;Seconds Part 
mov ah, 2Ch ; To get System Time 
int 21h 
mov al, dh  ; Seconds is in DH 
aam 
mov bx,ax 
call disp 

ret 

;Display Part 
disp proc 
mov dl, bh  ; Since the values are in BX, BH Part 
add dl, 30h  ; ASCII Adjustment 
mov ah, 02h  ; To Print in DOS 
int 21h 
mov dl, BL  ; BL Part 
add dl, 30h  ; ASCII Adjustment 
mov ah, 02h  ; To Print in DOS 
int 21h 
ret 
disp endp  ; End Disp Procedure 
  1. 내가 가상 상자에서이 enter image description here

  2. 를 얻을 나는이 enter image description here

무엇을 도와 드릴까요? 틀렸어?

답변

5

int 21h은 DOS 호출입니다.

DOS는 운영 체제입니다.

당신은 자신의 운영 체제를 작성하고 있습니다.

VirtualBox에는 사용자를 제외한 모든 OS가로드되어 있지 않습니다.

유일한 OS 인 경우 DOS를 호출 할 수 없습니다.

BIOS 서비스를 호출하지만 일반적으로 운영 체제는 하드웨어와 직접 대화합니다.

8086 소스 편집기, 어셈블러, 디스어셈블러 및 소프트웨어 에뮬레이터 (MSDOS와 가상 PC : 당신이 emu8086에 대한 태그 위키를 보면


, 당신은 (강조 광산)를 볼 수 있습니다 인터페이스)

관련 문제