2003-05-16 15:43:31 +02:00
|
|
|
.code16
|
|
|
|
.globl vm86_code_start
|
|
|
|
.globl vm86_code_end
|
|
|
|
|
|
|
|
#define GET_OFFSET(x) ((x) - vm86_code_start + 0x100)
|
|
|
|
|
|
|
|
vm86_code_start:
|
|
|
|
movw $GET_OFFSET(hello_world), %dx
|
|
|
|
movb $0x09, %ah
|
|
|
|
int $0x21
|
|
|
|
|
|
|
|
/* prepare int 0x90 vector */
|
|
|
|
xorw %ax, %ax
|
|
|
|
movw %ax, %es
|
|
|
|
es movw $GET_OFFSET(int90_test), 0x90 * 4
|
|
|
|
es movw %cs, 0x90 * 4 + 2
|
2007-09-17 10:09:54 +02:00
|
|
|
|
2003-05-16 15:43:31 +02:00
|
|
|
/* launch int 0x90 */
|
|
|
|
|
|
|
|
int $0x90
|
|
|
|
|
|
|
|
/* test IF support */
|
|
|
|
movw $GET_OFFSET(IF_msg), %dx
|
|
|
|
movb $0x09, %ah
|
|
|
|
int $0x21
|
|
|
|
|
2007-09-16 23:08:06 +02:00
|
|
|
pushf
|
2003-05-16 15:43:31 +02:00
|
|
|
popw %dx
|
|
|
|
movb $0xff, %ah
|
|
|
|
int $0x21
|
|
|
|
|
|
|
|
cli
|
2007-09-16 23:08:06 +02:00
|
|
|
pushf
|
2003-05-16 15:43:31 +02:00
|
|
|
popw %dx
|
|
|
|
movb $0xff, %ah
|
|
|
|
int $0x21
|
|
|
|
|
2007-09-17 10:09:54 +02:00
|
|
|
sti
|
2007-09-16 23:08:06 +02:00
|
|
|
pushfl
|
2003-05-16 15:43:31 +02:00
|
|
|
popl %edx
|
|
|
|
movb $0xff, %ah
|
|
|
|
int $0x21
|
2007-09-17 10:09:54 +02:00
|
|
|
|
2003-05-16 15:43:31 +02:00
|
|
|
#if 0
|
|
|
|
movw $GET_OFFSET(IF_msg1), %dx
|
|
|
|
movb $0x09, %ah
|
|
|
|
int $0x21
|
|
|
|
|
|
|
|
pushf
|
|
|
|
movw %sp, %bx
|
|
|
|
andw $~0x200, (%bx)
|
|
|
|
popf
|
|
|
|
#else
|
|
|
|
cli
|
|
|
|
#endif
|
|
|
|
|
2007-09-16 23:08:06 +02:00
|
|
|
pushf
|
2003-05-16 15:43:31 +02:00
|
|
|
popw %dx
|
|
|
|
movb $0xff, %ah
|
|
|
|
int $0x21
|
2007-09-17 10:09:54 +02:00
|
|
|
|
2003-05-16 15:43:31 +02:00
|
|
|
pushfl
|
|
|
|
movw %sp, %bx
|
|
|
|
orw $0x200, (%bx)
|
|
|
|
popfl
|
|
|
|
|
|
|
|
pushfl
|
|
|
|
popl %edx
|
|
|
|
movb $0xff, %ah
|
|
|
|
int $0x21
|
|
|
|
|
|
|
|
movb $0x00, %ah
|
|
|
|
int $0x21
|
|
|
|
|
|
|
|
int90_test:
|
2007-09-16 23:08:06 +02:00
|
|
|
pushf
|
2003-05-16 15:43:31 +02:00
|
|
|
pop %dx
|
|
|
|
movb $0xff, %ah
|
|
|
|
int $0x21
|
|
|
|
|
|
|
|
movw %sp, %bx
|
|
|
|
movw 4(%bx), %dx
|
|
|
|
movb $0xff, %ah
|
|
|
|
int $0x21
|
2007-09-17 10:09:54 +02:00
|
|
|
|
2003-05-16 15:43:31 +02:00
|
|
|
movw $GET_OFFSET(int90_msg), %dx
|
|
|
|
movb $0x09, %ah
|
|
|
|
int $0x21
|
|
|
|
iret
|
2007-09-17 10:09:54 +02:00
|
|
|
|
2003-05-16 15:43:31 +02:00
|
|
|
int90_msg:
|
|
|
|
.string "INT90 started\n$"
|
2007-09-16 23:08:06 +02:00
|
|
|
|
2003-05-16 15:43:31 +02:00
|
|
|
hello_world:
|
|
|
|
.string "Hello VM86 world\n$"
|
|
|
|
|
|
|
|
IF_msg:
|
|
|
|
.string "VM86 IF test\n$"
|
|
|
|
|
|
|
|
IF_msg1:
|
|
|
|
.string "If you see a diff here, your Linux kernel is buggy, please update to 2.4.20 kernel\n$"
|
|
|
|
|
|
|
|
vm86_code_end:
|