1. help with C compiling for Euphoria
- Posted by useless_ Oct 30, 2012
- 1524 views
How do i compile the C code on http://openeuphoria.org/pastey/164.wc so i can call it as a DLL from Euphoria, on a wintel box?
useless
2. Re: help with C compiling for Euphoria
- Posted by CoJaBo2 Oct 30, 2012
- 1494 views
How do i compile the C code on http://openeuphoria.org/pastey/164.wc so i can call it as a DLL from Euphoria, on a wintel box?
useless
That's for DOS; you simply cannot make real-mode function calls from protected-mode Windows.
You would have to use the Windows API; MSDN ought to have it listed. (If you can find the relevant functions, you should be able to call them from Eu using c_func, etc, you wouldn't need a DLL)
I assume this is for the disk access thread? A bigger problem may be that you cannot (as far as I'm aware) tell Windows to ignore a partition that it recognizes (leading to corruption), and ones that it does not (e.g., ext3) it likes to pester you to format for no apparent reason..
(If you need direct disk access, btw, note also that its downright trivial on Linux)
3. Re: help with C compiling for Euphoria
- Posted by jimcbrown (admin) Oct 31, 2012
- 1549 views
That's for DOS; you simply cannot make real-mode function calls from protected-mode Windows.
Ironically, the reverse is true: it is possible to make real-mode function calls from an MS-DOS app that call into protected-mode Windows. (This is done via fake cpu instructions called BOPs which communicate with NTVDM.)
4. Re: help with C compiling for Euphoria
- Posted by jimcbrown (admin) Oct 31, 2012
- 1543 views
How do i compile the C code on http://openeuphoria.org/pastey/164.wc so i can call it as a DLL from Euphoria, on a wintel box?
You can't, period. The closest you can get is to make a custom VDD (virtual device driver) and call that directly from a Windoze process, but that's miles away from calling code in a shared library.
It'd be easier to do everything (but the VDD itself, naturally) as an MS-DOS program - for a working example, see http://ww.japheth.de/Download/DOS/IDECHECK.zip (from http://www.masmforum.com/board/index.php?PHPSESSID=8d46cd4ecb1688be429ab49694ec53e6&topic=14801.0;wap2 )
If you really want to access the int13h results from a Windoze process, then the easiest way to do that is to make a simple MS-DOS program that runs the code in the pastey and writes the results to a file, and then have the Windoze program call the MS-DOS program and read the results from the file.