The LOADALL instruction

Programming, for all ages and all languages.
Post Reply
User avatar
Karlosoft
Member
Member
Posts: 277
Joined: Thu Feb 14, 2008 10:46 am
Location: Italy
Contact:

The LOADALL instruction

Post by Karlosoft »

http://www.rcollins.org/articles/loadal ... 3_doc.html
I found this document which speaks about this strange instruction.
It is powerfull... very powerfull I'd like to use it. Does anyone know if is implemented on newer processors under an other opcode or something similar? Is there any way to emulate it in a complete way?
User avatar
Coty
Member
Member
Posts: 286
Joined: Thu Feb 12, 2009 5:12 pm

Re: The LOADALL instruction

Post by Coty »

No, it has only been found on i286 and i386 according to the undocumented PC (book)... I also looked to see if any new processers found it, but I found nothing on the internet.. No it cannot be emulated on real hardware, because the CPU checks whether PM is enabled or not before letting you use paging, this was the biggest reseon it was used.

On both the i286 and i386 they also have different opcodes.
My hero, is Mel.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: The LOADALL instruction

Post by Combuster »

There is a "loadall" instruction on all modern processors - it's called RSM. It's however heavily protected and therefore not usable from the context of an OS.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
Karlosoft
Member
Member
Posts: 277
Joined: Thu Feb 14, 2008 10:46 am
Location: Italy
Contact:

Re: The LOADALL instruction

Post by Karlosoft »

thank you for the answers, what do you mean with heavily protected?
Tosi
Member
Member
Posts: 255
Joined: Tue Jun 15, 2010 9:27 am
Location: Flyover State, United States
Contact:

Re: The LOADALL instruction

Post by Tosi »

The processor has to be in system-management mode in order to execute the instruction, and the only way for that to happen as far as I recall is external to the CPU. It's only interesting/useful if you are writing firmware for SMM.
User avatar
turdus
Member
Member
Posts: 496
Joined: Tue Feb 08, 2011 1:58 pm

Re: The LOADALL instruction

Post by turdus »

Karlosoft wrote:http://www.rcollins.org/articles/loadall/tspec_a3_doc.html
I found this document which speaks about this strange instruction.
It is powerfull... very powerfull I'd like to use it. Does anyone know if is implemented on newer processors under an other opcode or something similar? Is there any way to emulate it in a complete way?
I'm not sure it's powerful. The problem with this kind of opcodes that they save and load a full set of processor state (registers, paging etc. depending on opcode), and it's usually MUCH faster to keep track what's changed and save and load only those. That's the reason why no mainline OS use hardware task switching.
User avatar
Karlosoft
Member
Member
Posts: 277
Joined: Thu Feb 14, 2008 10:46 am
Location: Italy
Contact:

Re: The LOADALL instruction

Post by Karlosoft »

The power of loadall is that you can load everything all the registers the hidden ones too. You can also load you cache descriptors XD this is powerfull XD
Tosi
Member
Member
Posts: 255
Joined: Tue Jun 15, 2010 9:27 am
Location: Flyover State, United States
Contact:

Re: The LOADALL instruction

Post by Tosi »

Did you read the article? Only two processors (286 and 386) supported LOADALL, and then the opcodes and format of the data were different. Would you like an operating system that only supports 386, or even worse, 286?

Not only that, it's really not that useful. You can load all of the registers, including the "hidden" ones, by setting up your descriptor tables correctly and loading most of the rest in the usual way.
User avatar
Karlosoft
Member
Member
Posts: 277
Joined: Thu Feb 14, 2008 10:46 am
Location: Italy
Contact:

Re: The LOADALL instruction

Post by Karlosoft »

I read the article, but it was a bit old, It has been written more than 10 years ago, this is why I wanted to know if it was any other more modern instruction of that kind on newer processors. I never take for granted what an article on a undocumented feature says ;)

The most but not all. And the cache descriptors have to be valid one, and you have to switch in protected mode in order to update them (unreal mode isn' it?)
Post Reply