Re: nasm segment directive



emu8086@xxxxxxxxxxxxxx wrote:

[snip]
Thanks for the example!

Likewise! (the ".com linking itself" example, too!)

I guess Linux's way is true :)

I don't know which way is "true"... I assume the difference is that you can alter the control word to (as I understand it) let the FPU handle the exception, or generate an irq (on a per-exception basis). That interrupt can be handled any way we like, I guess. To determine what the "native" behavior of the FPU is (as set up by the bios), we could design a bootsector to test the behavior. The difference we're seeing *must* be due to OS tweaking... I think.


There's a thread on clax about "Floating Point Exception" - a guy did an ordinary "div cl" without clearing ah (common newbie error). I recall having seen a "divide by zero" error message, from that error. That too is something an OS could hook and meddle with.

I'm not in the mood to fool with bootsectors right now, but when the spirit moves me, I'll try to remember to conduct those experiments. Always nice to know what's "really" hardware and what's the OS doing tricks.

I got bit by an "OS trick" the other day. Richard/PJ posted that link to the Linux Real Mode Interface library - http://lrmi.sf.net - didn't work on my system. Reported that the call failed, but didn't say why. I rebuilt the library with "DEBUG" defined, it informed me that the interrupt (10h) routine wasn't in ROM...

When I first installed Linux, it wasn't my "default" system, so instead of messing with lilo, I got in the habit of booting into dos, and starting Windows... or Linux via loadlin. I've continued that habit. Maybe dos is hooking int 10h(?). Sure enough, changing to boot straight to Linux via lilo cured it. (dunno what dos is doing with int 10h, but it seems to be doing something...)

Lots of interesting things to learn about these machines! :)

Best,
Frank
.



Relevant Pages

  • Re: Vectored Interrupt Fetch
    ... It is not just the interrupt vector ... We had a separate exception location for UTLBMISS, ... The other exceptions and interrupts trapped to a common locaiton, ... jump commoncode ...
    (comp.arch)
  • Re: Nette Features in C# 3.0
    ... 'normaler Interrupt' auseinanderdividert. ... heisst sie 'exception' und nicht 'interrupt'. ... >> diese 'Ausnahme' eben auch nur 'in Ausnahmen-Situationen' haben zu ...
    (de.comp.lang.misc)
  • Re: Nette Features in C# 3.0
    ... beschreibt 'exception' die Operation ... the interrupt mechanism ignores the exceptions that ... Solange ein Programm tut, was ich von ihm erwarte, interessiert mich ... Dass man mit kaputter Hardware schlecht kaputte Hardware testen kann, ...
    (de.comp.lang.misc)
  • Re: GetPC code (was: Shellcode from ASCII)
    ... I've been looking into FPU stuff a bit lately and decided to look into ... you can do a GetPC procedure without simulating any exception. ... the data stored by fnstenv isn't influenced by the exception nor ... using fstenv/fnstenv is to have previously executed an FP instruction. ...
    (Vuln-Dev)
  • Re: Nette Features in C# 3.0
    ... Begriffe dort gebraucht werden, beschreibt 'exception' die Operation ... der Hardware und 'interrupt' die dadurch ausgeloeste Operation einer ... Software (Beispiel: 'External and Decrementer are maskable interrupts ... Ein weiteres Beispiel fuer ...
    (de.comp.lang.misc)