🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.lang.asm
Article #367

Re: protected mode problem

#367
From: John S. Fine
Date: Wed, 18 Mar 1998 00:00
30 lines
1767 bytes
PR Schmitz wrote:

> When I 'switch' to protected mode using MOV CR0,EAX, The system reboots or
> crashes. What am I doing wrong? Can somebody please tell me?
. . .
>         gdtr    LABEL   FWORD
>                 DD      ?
>                 DW      15
. . .-
>         lea     ebx,gdtr
>         mov     DWORD PTR [ebx],eax
>         DB      66h
>         lgdt    gdtr

The gdt psuedo-descriptor should have the length first and the linear
address second.  You have it backwards.

I haven't checked for other errors in your code.

There is a well commented example of switching from real mode to
protected mode, which I wrote:

http://www.erols.com/johnfine/pmcom01.zip

It is in NASM syntax (not TASM), but I think it will help you anyway
to read it.
-- 
http://www.erols.com/johnfine/
http://www.geocities.com/SiliconValley/Peaks/8600/
Technical Details
Message-ID: <6ep4q9$ilp$2@winter.news.erols.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <6eonor$bb7$7@winter.news.erols.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: feaef,2226f239c4d199fa
X-Google-Attributes: gidfeaef,public
X-Google-Thread: f7d8d,2226f239c4d199fa
X-Google-Attributes: gidf7d8d,public
X-Google-Thread: 114917,2226f239c4d199fa
X-Google-Attributes: gid114917,public
From: "John S. Fine" <johnfine@erols.com>
Subject: Re: protected mode problem
Date: 1998/03/18
Message-ID: <6ep4q9$ilp$2@winter.news.erols.com>
X-Deja-AN: 335318651
Content-Transfer-Encoding: 7bit
References: <6eonor$bb7$7@winter.news.erols.com>
Mime-Version: 1.0
Reply-To: johnfine@erols.com
To: PR Schmitz <pschmitz@kabelfoon.nl>
Content-Type: text/plain; charset=us-ascii
X-Complaints-To: abuse@erols.com
X-Trace: winter.news.erols.com 890246793 19129 207.172.241.114 (18 Mar 1998 18:46:33 GMT)
Organization: Erol's Internet Services
Newsgroups: alt.lang.asm,borland.public.tasm,comp.lang.asm.x86