34 questions
0
votes
0
answers
57
views
How can i debug my graphics DJGPP programs?
Debugging in MS-DOS is one of the roadblocks that i have with MS-DOS programming, i'm using DJGPP and i have no complaints with it's gdb debugger, but the issues lies with the fact that once i turn on ...
0
votes
2
answers
735
views
Linking error [undefined reference to `asm_main()'] in linking Assembly to C
My exact issue is that am trying to get the linked final exe from 3 files namely:
The main c loader
The main asm file
The accessory asm file that holds the functions.
I manage to convert them all ...
0
votes
0
answers
255
views
Disable/enable USB interrupts in MSDOS
I use a program for MS-DOS that reads and writes data to the parallel port and uses the hardware timer for timing. It doesn't work unless I disable USB support in the BIOS. With USB enabled, it looks ...
3
votes
1
answer
525
views
Protected Hardware Interrupt Handler Stuck? (DJGPP)
I'm trying to set up a hardware interrupt handler in protected mode, using djgpp-2 for compiling in dosbox-0.74. Here's the smallest code possible (timer interrupt), I guess:
#include <dpmi.h>
#...
0
votes
1
answer
350
views
Keyboard handler causes segfault (djgpp)
Recently I decided, it would be funny, to code some simple MSDOS game. Needles to say, I need code for handling keyboard events.
This is what I came up with for testing:
int i, c = 0;
for ( i = 0; i ...
9
votes
1
answer
3k
views
Throwing C++ exceptions from a hardware exception handler. Why does -fnon-call-exceptions not behave as expected?
I had this funny idea last night, to trap hardware exceptions and throw a C++ exception instead. Thought that might be useful for things like FPU exceptions, which normally either crash, or silently ...
9
votes
1
answer
4k
views
Drawing a character in VGA memory with GNU C inline assembly
I´m learning to do some low level VGA programming in DOS with C and inline assembly. Right now I´m trying to create a function that prints out a character on screen.
This is my code:
//This is the ...
2
votes
1
answer
711
views
Waiting in DOS using djgpp -- alternatives to busy wait?
I recently wrote a little curses game and as all it needs to work is some timer mechanism and a curses implementation, the idea to try building it for DOS comes kind of naturally. Curses is provided ...
6
votes
3
answers
2k
views
Need C compiler for Windows 7 64-bit, to compile to DOS target
I'm trying to find a solution to allow me to compile C code to a DOS executable from Windows 7 64-bit. I recently updated from XP 32-bit to Win7 64-bit, and now my Borland C++ 5.0 compiler won't work....
1
vote
3
answers
2k
views
Use fscanf to read two lines of integers
I want to ask something that I write in C.
I use the fopen() command to open and read a text file that contains only two lines. in
first line is an integer N number, and in the second line is the ...
0
votes
2
answers
509
views
djgpp compiled harbour exe does not run in pure dos
I have compiled one clipper program using haarbour compiler and the c file produced was compiled using djgpp to produce final exe. This exe runs fine in console window of Windows 98.
However, when I ...
0
votes
1
answer
392
views
MinGW for Windows doesn't work when I try to link with LD
I am developing a test OS right now in C... and I've been looking on http://www.osdever.net/tutorials/view/brans-kernel-development-tutorial to get started. I got MinGW for Windows 7 (64-bit). I set ...
1
vote
0
answers
1k
views
How to disable "'variable' undeclared (first use in this function)" warning in RHIDE (DJGPP)
I have an old C program (which I didn't write) which worked for me before on a machine I had using DJGPP with RHIDE under DOS.
The problem is, that since I've moved to a new machine, when I try and ...
2
votes
2
answers
2k
views
FreeDOS + RHIDE (DJGPP environment) = DOS Memory Corruption?
I'm running a virtual machine (using Oracle VM VirtualBox) with FreeDOS installed.
After I enter the DJGPP IDE (called "RHIDE") and run an application once, I can no longer run anything, and when I ...
3
votes
3
answers
3k
views
Compiling Assembly code
I'm trying to compile an ASM program I wrote with NASM and the "ld" command from DJGPP. This is the code for the batch file I'm using to compiling it:
@echo off
set path=C:\NASM;%PATH%
nasm -f aout -...
2
votes
2
answers
1k
views
How to enable the mouse in C++ program under DOS using DJGPP?
I've been using DJGPP for the first time recently and can't seem to enable mouse support. What's the best way?
Thanks for any help.
0
votes
2
answers
463
views
fread error with DJGPP
While reading a binary file using DJGPP on DOS this code hangs.
This happens when the fread call is made. If the call is removed then the program runs successfully.
The same code runs fine through ...