Re: How is MOVSD supposed to work?
Posted: Wed Jun 15, 2016 7:29 am
The Place to Start for Operating System Developers
https://f.osdev.org/
I think you're right.Octocontrabass wrote:I only use the "int 0x15" name because it's handled by the int 0x15 dispatcher; I have no idea how you're actually supposed to call it.Brendan wrote:It's NOT designed to be called from protected mode. That doesn't even make any sense.
I've disassembled one BIOS that supports int 0x15 function 0xe881. Its int 0x15 dispatcher explicitly avoids using any instructions that would differ between 16- and 32-bit mode before the branch to the function 0xe881 handler. The function 0xe881 handler disassembles to nonsense in 16-bit mode, but in 32-bit mode it disassembles to a function that loads EAX, EBX, ECX, and EDX to the expected values and then returns. It returns the same values as int 0x15 function 0xe801.
It's obviously meant to be called in the same way as the 32-bit EISA BIOS functions (int 0x15 functions 0xd880-0xd8ff), which are handled similarly by this BIOS. Unfortunately, I haven't found any real documentation on how those were supposed to be called, either. RBIL only mentions them briefly on the 16-bit equivalents (int 0x15 functions 0xd800-0xd87f).
I assumed it was called "32-bit" in Ralph Brown's list simply because it uses 32-bit registers; and thought that maybe it was designed to be a little future-proof and that on systems with more than 4 GiB of RAM it'd say there's more than 0xFFFF 64 KiB blocks of extended memory (but still less than 0xFFFF blocks configured due to the "PCI hole").neon wrote:RBIL actually does mention that its 32 bit - right there in its name - "Phoenix BIOS v4.0 - GET MEMORY SIZE FOR >64M CONFIGURATIONS (32-bit)" It would be nice to find a more authoritative source though but expect the details to differ between systems anyways. Don't confuse E881h with E801h.
Why worry?Kazinsal wrote:False. You can definitely hang a system that has no keyboard controller just by attempting to read from or write to it once, no loops involved. See all x86 Macs.There's no way to hang the system, unless you use an infinite loop and a specific, real machine model that is known for not having a KBC. Also, at this point no other modern peripherals would use I/O ports or memory regions of legacy devices. It would make things much more dirty regardless of whether they are still there or not.
I remember that there's a bit in one of the KBC registers that lets you reset the system. This is how everyone uses to reset the OS with software. It should be documented in the wiki.Kazinsal wrote:If the system resets or hangs when you frob the A20 line or the keyboard status port then you don't have a keyboard controller. Simple as that.~ wrote:If you reset the system, the KBC is more likely there. That's another of its functions, and if you aren't careful you can reset the system at the same time that you're trying to enable the A20.
Because either the chipset will cause a reset or lock up in hardware, or the firmware will cause problems in SMM mode; and it won't make any difference if you diddle with the IO port/s using V86 mode or not.~ wrote:Why worry?Kazinsal wrote:False. You can definitely hang a system that has no keyboard controller just by attempting to read from or write to it once, no loops involved. See all x86 Macs.There's no way to hang the system, unless you use an infinite loop and a specific, real machine model that is known for not having a KBC. Also, at this point no other modern peripherals would use I/O ports or memory regions of legacy devices. It would make things much more dirty regardless of whether they are still there or not.
Then, why not implement a journaled initialization layer that stores data on disk? If it locks up or resets, it will continue where it left, using also the good configuration and initialization methods proven so far.Brendan wrote:Because either the chipset will cause a reset or lock up in hardware, or the firmware will cause problems in SMM mode; and it won't make any difference if you diddle with the IO port/s using V86 mode or not.
Cheers,
Brendan
You can base the initialization tasks on testing the results. You can have an API to record what worked and what didn't.Kazinsal wrote:Stop taking about make-believe virtualization layers and listen to the people who know what they're talking about.
If you frob hardware that doesn't exist, bad things happen. Worse things happen if you frob hardware that the chipset and a microcontroller don't agree on whether or not they exist. Let's say there's something attached to ISA port 0x60 and 0x64, but the chipset has it lazily turned "off". A byte goes out I/O port 0x60, the CPU waits on the chipset to hand it over, the chipset just ignores it and doesn't tell the CPU that it's releasing the I/O bus. System hangs. Or maybe the chipset, knowing full well that the keyboard controller is off, decides the only thing that you could possibly want if you frob the keyboard controller is to pulse the reset line. System resets.
And don't tell me this doesn't happen, because it happens, and I've seen it happen several times.
Because it's trivial to get A20 right (and avoid all the pitfalls) using well known (and already described) practices; without needing any over-complicated (and therefore error prone) mess to deal with problems caused by not doing A20 right.~ wrote:Then, why not implement a journaled initialization layer that stores data on disk?Brendan wrote:Because either the chipset will cause a reset or lock up in hardware, or the firmware will cause problems in SMM mode; and it won't make any difference if you diddle with the IO port/s using V86 mode or not.
The intention would be to give the system all the chances to boot successfully. Always taking into account a balance of the number of layers to add to one same thing, maybe the initialization structures in RAM could have a checksum and a signature. If they are still there after a reboot, we can know where to continue. It would probably be too unreliable.Brendan wrote:Hi,
Because it's trivial to get A20 right (and avoid all the pitfalls) using well known (and already described) practices; without needing any over-complicated (and therefore error prone) mess to deal with problems caused by not doing A20 right.~ wrote:Then, why not implement a journaled initialization layer that stores data on disk?Brendan wrote:Because either the chipset will cause a reset or lock up in hardware, or the firmware will cause problems in SMM mode; and it won't make any difference if you diddle with the IO port/s using V86 mode or not.
Journaling might be a good idea later during boot (e.g. after you've got kernel, storage drivers and file systems started, which may include networking and NFS for diskless machines), when you're starting "less essential" drivers (sound, video, USB, keyboard, etc). Before you've got file systems working it's far too complicated (until/unless reliable "non-volatile main memory" becomes ubiquitous?).
Cheers,
Brendan
The intention would be to increase the probability of booting successfully (which is fine/admirable); but in practice too much complexity too early has the opposite effect and reduces the probability of booting successfully.~ wrote:The intention would be to give the system all the chances to boot successfully.
Yes, it's easy to implement one of the world's worse file systems and completely ignore any hope of security, ignore the chance of file system corruption and other errors, etc. However this makes the huge assumption that you're able to find and access (and write to) the disk in the first place; which means there's a large number of corner cases where it's going to fail (disk errors, booting from hard disk when you're FAT partition is on USB flash and BIOS "int 0x13" doesn't give you access, GPT partitioned disk where the "protective MBR" doesn't mention the partition you want, diskless machines that boot from network, booting from CD where writes aren't possible and FAT is inappropriate, USB flash where you write on one machine then plug it into another and wonder why everything is different now, etc).~ wrote:It's easy to implement a FAT file system in the sense that it doesn't take that many Kilobytes. It just needs to be well debugged. Once it's written, it will be of big help from now on so even if it takes months of thinking it will be worthy.
LSD is a drug. Don't use drugs.ggodw000 wrote:my motto regarding this issue. use LSD (lowest common denominator). If there is a substitute approach using simpler instruction use it.
Unless it's a Limited Slip Differential - they're awesome (and should be used).gerryg400 wrote:LSD is a drug. Don't use drugs.ggodw000 wrote:my motto regarding this issue. use LSD (lowest common denominator). If there is a substitute approach using simpler instruction use it.
Don't use LSD radix sorts either!gerryg400 wrote:LSD is a drug. Don't use drugs.ggodw000 wrote:my motto regarding this issue. use LSD (lowest common denominator). If there is a substitute approach using simpler instruction use it.