Back to real mode

Is it possible to go back into real mode (as in the processor mode) from
in a device driver? I’ve heard that it is possible to do, usually so that a
bios call can be made. Anyone have some code/a link/some pointers on how to
go about doing this? (Just setting CR0 to 0 causes windows to … well, get
upset.)

And before anyone asks, I’m NOT doing this in some sort of kernel mode
device driver that I plan to release. I’m a college student just poking
around in windows where I shouldn’t be, just for fun. I don’t want to spark
another long discussion about what should or should not be done. I’m just
hoping that someone can give me some pointers that will speed things up.

Thanks,
-brian


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Ok, then the best pointer is … DON’T!!.

Seriously, if you really really need real mode, then boot DOS and play all
day. There is NO reason to go back to real mode, unless all you want to do
is play. And then I stand by my original statement. All of the BIOS
information is provided to a kernel mode. Change your thinking. In modern
Windows operating systems, real mode is used for one thing … loading the
loader to load the OS.

Maybe the answer to this perennial frigging question is: If you need real
mode, replace the boot sector that the BIOS reads, do what the hell you want
in real mode, then admit defeat and go back and load the OS loader. But quit
asking about dropping BACK into real mode within a driver.

So sayeth the curmudgeon … and if someone would loan me 1.90 I could go to
StarBucks.

Gary G. Little
Broadband Storage, Inc.
xxxxx@broadstor.com
xxxxx@inland.net
(949) 7372731

-----Original Message-----
From: Argus [mailto:argus@vt.edu]
Sent: Tuesday, December 18, 2001 9:15 PM
To: NT Developers Interest List
Subject: [ntdev] Back to real mode

Is it possible to go back into real mode (as in the processor mode) from
in a device driver? I’ve heard that it is possible to do, usually so that a
bios call can be made. Anyone have some code/a link/some pointers on how to
go about doing this? (Just setting CR0 to 0 causes windows to … well, get
upset.)

And before anyone asks, I’m NOT doing this in some sort of kernel mode
device driver that I plan to release. I’m a college student just poking
around in windows where I shouldn’t be, just for fun. I don’t want to spark
another long discussion about what should or should not be done. I’m just
hoping that someone can give me some pointers that will speed things up.

Thanks,
-brian


You are currently subscribed to ntdev as: xxxxx@broadstor.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

If you’re in Win9x, a VxD will give you some of that. In NT, I agree,
there’s no real reason to do it. Precisely what Bios call you want to be
able to make ? Yet, you know, doing it is jolly easy, provided of course you
either disable interrupts or instate your own vectors: all you have to do is
to setup a suitable descriptor, and call it, and set up the machine to
return from it the right way: the Intel Pentium Architecture book is
available online, no cost, at http://developer.intel.com, and all the
information is in there. A little assembly required, and presto! You have
enough rope to hang yourself multiple times. If you want to be able to call
Bios functions, you’d better know what you’re doing, and what the Bios needs
as far as machine support is concerned. But watch out, once you do that kind
of thing, you’re on your own, and you must manage the whole machine: Windows
will have gone out to lunch. Hey, this would be a great final exam for an OS
course, “write a piece of code to take over control of the machine, go into
real mode, issue a bios call, and come back to protected mode with the
result.” - anyone who passes that course call me and I’ll have a slot
waiting for him or her in the SoftICE development team. :slight_smile:

Seriously, now, here’s a problem I’m not too sure is easily solved: write a
program to set a video board’s mode if Window’s out to lunch. Wouldn’t it be
great if I could just go into the Bios, issue an int 10h, and done ? But,
life’s not ever that simple. Meanwhile, we dream of the day when the Bios is
a protected mode entity, no more real mode anywhere: geek utopia.

Alberto.

-----Original Message-----
From: Gary Little [mailto:xxxxx@Broadstor.com]
Sent: Wednesday, December 19, 2001 11:10 AM
To: NT Developers Interest List
Subject: [ntdev] RE: Back to real mode

Ok, then the best pointer is … DON’T!!.

Seriously, if you really really need real mode, then boot DOS and play all
day. There is NO reason to go back to real mode, unless all you want to do
is play. And then I stand by my original statement. All of the BIOS
information is provided to a kernel mode. Change your thinking. In modern
Windows operating systems, real mode is used for one thing … loading the
loader to load the OS.

Maybe the answer to this perennial frigging question is: If you need real
mode, replace the boot sector that the BIOS reads, do what the hell you want
in real mode, then admit defeat and go back and load the OS loader. But quit
asking about dropping BACK into real mode within a driver.

So sayeth the curmudgeon … and if someone would loan me 1.90 I could go to
StarBucks.

Gary G. Little
Broadband Storage, Inc.
xxxxx@broadstor.com
xxxxx@inland.net
(949) 7372731

-----Original Message-----
From: Argus [mailto:argus@vt.edu]
Sent: Tuesday, December 18, 2001 9:15 PM
To: NT Developers Interest List
Subject: [ntdev] Back to real mode

Is it possible to go back into real mode (as in the processor mode) from
in a device driver? I’ve heard that it is possible to do, usually so that a
bios call can be made. Anyone have some code/a link/some pointers on how to
go about doing this? (Just setting CR0 to 0 causes windows to … well, get
upset.)

And before anyone asks, I’m NOT doing this in some sort of kernel mode
device driver that I plan to release. I’m a college student just poking
around in windows where I shouldn’t be, just for fun. I don’t want to spark
another long discussion about what should or should not be done. I’m just
hoping that someone can give me some pointers that will speed things up.

Thanks,
-brian


You are currently subscribed to ntdev as: xxxxx@broadstor.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: xxxxx@compuware.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Quoth Alberto:

Meanwhile, we dream of the day when the Bios is
a protected mode entity, no more real mode anywhere: geek utopia

Very simple… Just use an IBM PS/2 Model 80!!! :slight_smile: They had the ABIOS.
Anyone remember that? :slight_smile:


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

> Is it possible to go back into real mode (as in the processor mode) from

in a device driver? I’ve heard that it is possible to do, usually so that a
bios call can be made.

VideoPortInt10, which calls Kei386CallBios.
Surely this will be V86 mode and not real.

Max


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

> is play. And then I stand by my original statement. All of the BIOS

information is provided to a kernel mode.

Oh no, for instance, the BIOS disk numbering is unknown to NT at all.

Max


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Don’t be such a spoil-sport. Here we have someone who perhaps wants to understand how the
processor really works, and I think we should encourage this.

Brian, you want to find a copy of the
"The IA-32 Intel Architecture Software Developer’s Manual, Volume 3: System Programming Guide ".

This describes all of the low level hardware registers and memory management units. Traveling to the country
you propose without the guide book will be a disaster. Read it.

If you disable all interrupts, or at least insert your own interrupt handlers into the system vector,
then when you disable the MMUs, you’ll actually stay it that mode.
You should be able to get into real mode with only a small number of instructions, but I’ve never
done this on an X86. Remember the debugger won’t work. Remember that you program counter will change.

-DH

----- Original Message -----
From: “Gary Little”
To: “NT Developers Interest List”
Sent: Wednesday, December 19, 2001 11:09 AM
Subject: [ntdev] RE: Back to real mode

> Ok, then the best pointer is … DON’T!!.
>
> Seriously, if you really really need real mode, then boot DOS and play all
> day. There is NO reason to go back to real mode, unless all you want to do
> is play. And then I stand by my original statement. All of the BIOS
> information is provided to a kernel mode. Change your thinking. In modern
> Windows operating systems, real mode is used for one thing … loading the
> loader to load the OS.
>
> Maybe the answer to this perennial frigging question is: If you need real
> mode, replace the boot sector that the BIOS reads, do what the hell you want
> in real mode, then admit defeat and go back and load the OS loader. But quit
> asking about dropping BACK into real mode within a driver.
>
> So sayeth the curmudgeon … and if someone would loan me 1.90 I could go to
> StarBucks.
>
> Gary G. Little
> Broadband Storage, Inc.
> xxxxx@broadstor.com
> xxxxx@inland.net
> (949) 7372731
>
> -----Original Message-----
> From: Argus [mailto:argus@vt.edu]
> Sent: Tuesday, December 18, 2001 9:15 PM
> To: NT Developers Interest List
> Subject: [ntdev] Back to real mode
>
> Is it possible to go back into real mode (as in the processor mode) from
> in a device driver? I’ve heard that it is possible to do, usually so that a
> bios call can be made. Anyone have some code/a link/some pointers on how to
> go about doing this? (Just setting CR0 to 0 causes windows to … well, get
> upset.)
>
> And before anyone asks, I’m NOT doing this in some sort of kernel mode
> device driver that I plan to release. I’m a college student just poking
> around in windows where I shouldn’t be, just for fun. I don’t want to spark
> another long discussion about what should or should not be done. I’m just
> hoping that someone can give me some pointers that will speed things up.
>
> Thanks,
> -brian
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@broadstor.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
> —
> You are currently subscribed to ntdev as: xxxxx@syssoftsol.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com