I have compiled the cross-compiler in CYGWIN and it functions.
In REAL-MODE assembly I can setup the GDT and get into PMODE with the interupts disabled (cli).
Then I write confirmation out to video twice in assembly calling an assembly procedure "ax_vid_32".
In between the video ouputs I can call an externally defined c "main", which is an empty function:
Code: Select all
int main()
{
return 0;
}
Both video outputs are visible and the program hangs with a "hang: jmp hang"
There are three files:
1. Second.asm (sets up GDT, switches to PMODE outputs to video via "ax_vid_32" in UTIL32.ASM and calls the "main" in kernel.c
2. kernel.c (which calls the video out routine "ax_vid_32" in UTIL32.ASM)
3. UTIL32.ASM (containing "ax_vid_32")
These won't link properly with this:
Code: Select all
i586-elf-ld -T link.ld -o SECOND.BIN SECOND.o kernel.o UTIL32.o
Problem:
I want to call the video output procedure in assembly to confirm I can do something in the main function
that calls assembly procedures. But the pc (virtual machine in VMware) crashes (triple-fault?) after the first video output.
The modified "main" looks like this:
Code: Select all
extern void ax_vid_32();
int main()
{
ax_vid_32();
return 0;
}
If you would be so kind please let me know what else to provide.
This is my first use of the forum.
Jon