All of the Video handling code is in the "video" subdirectory.
There is one file for each video card or chipset and the master file. To Add a new card, it needs a set of save & restore routines putting in a file here.
These are the functions defined in env/video/video.c.
Set pointer to correct structure of functions to initialize, close, etc... video routines.
Here the sleeping lion will be awoken and eat much of CPU time !!!
The result of setting VM86_SCREEN_BITMAP (at state of Linux 1.1.56): Each vm86 call will set 32 pages of video mem RD-only (there may be 1000000 per second) Write access to RD-only page results in page-fault (mm/memory.c), which will set a bit in current->screen_bitmap and calls do_wp_page() which does __get_free_page(GFP_KERNEL) but frees it immediatly, because copy-on-write is not neccessary and sets RD/WR for the page. (this could happen 32000000 per second, if the CPU were fast enough) It would be better to get the DIRTY-bit directly from the page table, isn't it? A special syscall in emumodule could do this.
-----
reserve_video_memory()
This procedure is trying to eke out all the UMB blocks possible to maximize your memory under DOSEMU. If you know about dual monitor setups, you can contribute by putting in the correct graphics page address values.
These are the functions defined in env/video/X.c.
Allocates a colormap for 256 color modes and initializes it.
Destroys the window, unloads font, pixmap and colormap.
Resizes the window, also the graphical sizes/video modes. remember the dos videomodi
This function seems to be called each screen_update :( It is called in base/mouse/mouse.c:mouse_cursor(int) a lot for show and hide.
Redraws the entire screen, also in graphics mode Used for expose events etc. returns: nothing
Arguments are:
Updates, also in graphics mode Graphics in X has to be smarter and improved returns: 0 - nothing updated 2 - partly updated 1 - whole update
Arguments are:
places the mouse on the right position Not tested in X with graphics returns: nothing
Arguments are:
These are the functions defined in env/video/dualmon.c.
Initializes the monochrome card. First detects which monochrome card is used, because the Hercules RamFont and the Hercules InColor need one more register to be initialized. If there is no monochrome card at all, we just think there is one and poke an peek in the void. After the detection the card is initialized. returns: nothing
Arguments are:
After MDA_init() the VGA is configured, something in video.c or console.c "reprograms" the monochrome card again in such a way that I always have to run hgc.com before I can use any program that uses the monochrome card. I've spent a day trying to find it, but I can't figure out. Something is writing to one of the following ports: 0x3b4, 0x3b5, 0x3b8, 0x3b9, 0x3ba, 0x3bb, 0x3bf. The problem occurs at (at least) the following 2 systems:
- AMD 386DX40, Trident 9000/512Kb ISA, Hercules Graphics Card Plus - Intel 486DX2/66, Cirrus Logic 5426/1Mb VLB, Hercules clone
The problem doesn't occur when I start dosemu from a telnet connection or from a VT100 terminal. (Erik Mouw, jakmouw@et.tudelft.nl)