Ed Beroset writes:
> That's further than I get. Here's what happens when I attempt to
> assemble this under Linux (two different versions of the RedHat
> distribution, FWIW) using the GNU assembler, version 2.7:
GNU assembler version 970202 (i486-linux), using BFD version 2.7.0.9
This is from Debian Linux 1.3
> It seems to me that GAS, at least the version I have, just isn't up to the
> task. I wonder if this isn't the root of Paul's problems?
I came to the same conclusion-- it's making 32-bit memory references
despite the .code16 directive. So I tried a Nasm0.94 version, which
assembles correctly but I think it jams because of the load address,
we need to setup the offsets.....
;
;nasm -f bin setup2.asm -o setup2.bin
;
;
bits 16
section .text
global _start
;org 0x100
_start:
mov ax,cs
mov ds,ax
mov es,ax
mov ss,ax
mov sp,0xfff0
mov ah,0x3
mov bh,0x0
int 0x10
mov ax,0x1301
mov bx,0x7
mov bp,msg ; + offset
mov cx,[ msg_length ] ; + offset
int 0x10
cli
mov al,0x80
out 0x70,al
lgdt [ gdt_descriptor ] ; + offset
lidt [ idt_descriptor ] ; + offset
o32 mov eax,cr0
or al,0x1
o32 mov cr0,eax
;jmp dword 0x8:0x1000
jmp $
gdt_descriptor dw 0x0017
dd 0x00000000
dd 0x00000000
dd 0x00CF9A00
dd 0x00000FFF
dd 0x00CF9200
dd 0x00000FFF
idt_descriptor dw 0x0000
dd 0x00000000
msg db 'Entering protected mode...',0x0D,0x0A
msg_length dw $ - msg
--- ifmail-tx (i386 Linux)
---------------
* Origin: James Vahn (jvahn@short.circuit.com) (1:346/15.1)
|