Author Topic: How is Protected Mode enabled in 16 Bit NASM?  (Read 10708 times)

Offline T145

  • Jr. Member
  • *
  • Posts: 12
  • Country: 00
  • Hacker, Jacker & All-Around Gobsmacker
    • CodeReview
How is Protected Mode enabled in 16 Bit NASM?
« on: November 21, 2019, 03:50:49 AM »
I've scoured the web trying to find any mention of enabling protected mode, to no avail. If anyone here happens to know I'd love to learn how!

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: How is Protected Mode enabled in 16 Bit NASM?
« Reply #1 on: November 21, 2019, 06:34:55 AM »
Hi T145,

Welcome o the forum!

The net used to be full of this information. Can't find much now...

This is not a useful answer:
Code: [Select]
mov eax, cr0
or al, 1
mov cr0, eax
... now you're in protected mode. However... first you need to load a global descriptor table. This is an array of selectors. The format if these selectors must be for the convenience if the hardware - it sure isn't for the convenience if programmers!

I used to have examples up until about two years ago when my computer crashed with no recent backup. Older backup is on CD... and the new machine has no CD player. So I can't help you much.

I'll look more...

Best,
Frank


Offline T145

  • Jr. Member
  • *
  • Posts: 12
  • Country: 00
  • Hacker, Jacker & All-Around Gobsmacker
    • CodeReview
Re: How is Protected Mode enabled in 16 Bit NASM?
« Reply #2 on: November 28, 2019, 03:19:02 AM »
I assume that also utilizes %use altreg?

Offline Frank Kotler

  • NASM Developer
  • Hero Member
  • *****
  • Posts: 2667
  • Country: us
Re: How is Protected Mode enabled in 16 Bit NASM?
« Reply #3 on: November 28, 2019, 06:09:40 AM »
I don't think so, no.

Thanks for reminding me I'm supposed to be looking for an example.

Best,
Frank


not what I was looking for but try this:

http://www.osdever.net/tutorials/view/the-world-of-protected-mode

« Last Edit: November 28, 2019, 07:05:31 AM by Frank Kotler »