DOS 7.1 programming for Intel EP80579

Started by suryakant, March 09, 2010, 05:19:14 AM

Previous topic - Next topic

MichaelW

Quote from: suryakant on March 24, 2010, 10:17:02 AM
Quote from: redskull on March 19, 2010, 12:13:21 PM

1) Switch into protected mode, setup a segment register, and switch back


Will someone provide me sample of this option? I searched on net, i got few samples but they are confusing? also none of them worked well.
I would like to set GS or FS segment register with base address 0 & segment limit of 4GB.

I provided a link to a simple example in my first post in this thread.
eschew obfuscation

suryakant

Thanks all,

when my application runs, its in real mode (but not in virtual 8086 mode).

Following is the dump of EFLAGS: 00007202 h  &  CR0 : 00000011h

I used following code to display these values. Now how to go ahead?

            pushfd
            pop eax
            mov DisplayValue, eax      ; Value to be displayed
            call displayLong            

            mov eax, cr0
            mov DisplayValue, eax      ; Value to be displayed
            call displayLong            

suryakant

Quote from: MichaelW on March 24, 2010, 06:11:17 PM

I provided a link to a simple example in my first post in this thread.

I used the same code, but when LGDT instruction is executed, processor hangs.

MichaelW

Quote from: suryakant on March 25, 2010, 04:48:02 AM
I used the same code, but when LGDT instruction is executed, processor hangs.

Did you try the EXE that I provided?
eschew obfuscation

suryakant

Quote from: MichaelW on March 25, 2010, 06:26:27 AM
Quote from: suryakant on March 25, 2010, 04:48:02 AM
I used the same code, but when LGDT instruction is executed, processor hangs.

Did you try the EXE that I provided?


Yes,  It displays following and hangs. (pressing key has no effect, does not return to dos prompt)

EAD404920231312F32332F303900FC00
1
1

MichaelW

Are you running this on the EP80579, or some other system? It looks like the A20 address line is already enabled, so try eliminating the call to EnableA20_PS2 and see if that helps. HIMEM.SYS had approximately 20 A20 address line handlers to cover the variety of hardware available at the time. I provided only one, that I'm guessing uses the most common method today, but I don't actually know this.


eschew obfuscation

suryakant

Thanks Micheal, thanks all.

In Config.sys  dos was loaded in high memory, also HIGHMEM.SYS and EMM386.SYS were loaded. I removed them

Now application runs in real mode first, switches successfully to protected mode and comes back...

Thanks again Micheal for providing code with exe.

Now i ll concentrate on my main application code... I ll update as I move ahead..  :bg

clive

Quote from: suryakant
Also I need to write application software in C. Visual Studio 2008 does not seem to support dos function calls in C... also I could not get proper switches to compile program for 16 bit OS. Shall I go for Turbo C for DOS for application programming and MASM in Visual Studio for Device drivers? Will I need to do some changes?

Back when I did this kind of stuff and did C and assembler in 32-bit under DOS, I'd use Watcom and a DOS-Extender (DOS4GW, PMW, Causeway, DOS32A). You could pretty much do all the driver and interrupt stuff within a "monolithic" application. The Watcom compiler/linker could generate 32-bit applications for a lot of platforms, pulled 32-bit objects built with MASM. It was also easy enough to write code to load and bind Win32 drivers, EXE and DLLs. I was doing magnetic tape, CD/DVD burning, and 802.11 PCI/PCMCIA wireless, but applications like Ghost and DriveImage used similar methods to deliver platform agnostic DOS 32-bit solutions. Pretty much all my Win32 console apps (using stdio/stdlib) can be built for DOS by simply recompiling.

For 16-bit stuff Microsoft C (5.x, 6.0, 7.0, 8.0 [MSVC 1.52c]), MASM (5.x, 6.xx) worked well, Turbo C 2.x or 3.x or TASM would all be quite workable too. I think Watcom would do 16-bit too, but I always used it for 32-bit.

If you're running on anything 386 or beyond, doing much 16-bit coding seems like an unnecessary exercise.

-Clive
It could be a random act of randomness. Those happen a lot as well.

suryakant

Hi all,

I have successfully written test code to transmit & receive one byte on CAN...   :bg
Now its time to go for full fledged driver... Hope you people are there for me  :bg

Thanks friends,,,  :U