As I'm going to be away for some time, I thought I should present a brief status of the current situation on the code I'm developing (that can be found on the "org.colinux.nlucas" branch). For easy review, lxr browsing is available at: * http://lxr.xpto.ath.cx/source/?v=my-tree (host source) * http://lxr.xpto.ath.cx/source/?c=kernel;v=my-tree (kernel source) And there are pre-compiled binaries here: * http://xpto.ath.cx/colinux/releases/my_builds/ [NOTE: I have very few modules compiled, so it may not work with all environments] My objective when I started this was to work on the colinux FLTK console enough so that it could replace the NT one with the added features. In my idea, there is no reason to support two consoles if one does everything the other does (and NT is not portable, while FLTK is). There may still be the need to develop a second console for people who only work in text mode (so one doesn't need X to use the colinux console, or for those using remote access), but for now ssh and putty are much better alternatives for those cases, and fully portable. ;-) == cocon == I reimplemented the cocon code to use shared memory between colinux and the user space application. The amount of memory is by default 1MB (because it will be used with cofb also), but can be as low as 4KB for cocon to work (but no font set and limited scroll back, off course). By adding "video_mem=2048" you can define the size of the video memory (in KB). By adding "vga=100x40" to the boot options, it's possible to start with a different console size, but the same can be done (per console) with "stty" commands. Right now, cofb can't be loaded as module, so it has to be explicitly turned off if you want to use cocon only, by adding "video=cofb:off" to the boot params. One thing that needs to be done is to optimize the console drawing. Right now I'm doing a full redraw when something changes, but on a modern pc it has no big CPU usage. It's about 2-10% CPU usage on heavy console changes with my P4@1.7GHz (ATI Radeon 9600 SE). It could be problematic for users with very weak graphic cards, but then they would not be able to run windows anyway ;-) Full copy/paste is implemented and scroll back is only limited by the amount of video memory. == cofb == Using the same shared memory, I implemented a basic cofb driver. The FLTK console will "switch" to render one or other mode and most cofb apps will work with it. FLTK can not draw 16 bit color raw images, so I made it so it can render them as gray scale. The reason is that some fb apps only work with 16 bpp and that allows us to render something (one example is qingy, a "getty" replacement). 24 and 32 bpp work more or less ok. I didn't implement the color mapping handling, so some colors appear "weird". For setting the desired startup resolution, add "video=cofb:800x600x32" to the boot parameters, but note that higher resolution would need more memory (the example above would need a "video_mem=2048" parameter). The default is 640x480x24, to fit the default 1MB video memory size. This will make fbcon to create a 80x30 console. fbset is another option to change the resolution, but will be per virtual console. An example is "fbset -xres 640 -yres 400 -depth 32". Copy from the cofb console is not working, because there is no way to obtain the text from the video memory. A possible solution is to implement a function to get it from the colinux side (by obtaining it from the current virtual console back buffer). Some screen shots are here: * http://www.xpto.ath.cx/colinux/misc/cofb/cofb_boot.png * http://www.xpto.ath.cx/colinux/misc/cofb/cofb_links.png =========== In the long term, some things will need to be done better, as there were some "hacks" that should be re-implemented (maybe with a large restructure of the colinux code), but the aim was to get a working version with as few bugs as possible. Also, comouse works but needs a "calibrate" function to work on different resolutions (in cocon and cofb). It could be better to hide the mouse when over the console screen, so only a mouse cursor is visible (and show it on "Mark"). Because fb apps can mmap the fb memory and write directly to it, the cofb console renderer is a bit heavier on the CPU usage, because we need to keep refreshing it to account for those cases (I'm forcing a refresh if 500 msecs elapsed to account for it). A possible better way is the proposed dirty page bit check to signal when changes have been done, so there is no need to have this extra CPU usage. Even so, in my machine the CPU usage for cofb is in the 5-10% range, which is much lower than the CPU usage for Dev-C++ and Mozilla Thunderbird while typing. ;-) Also, the CPU usage drops to zero if the FLTK console is minimized. Note that I took care in limiting CPU usage, so it never redraws the screen before at least 100 msecs elapse. Another thing that needs better codding is the "marking" drawing. It's real ugly, but at least it seems to work. I left another implementation #ifdef'ef, but it uses 100% CPU to do it in a fancier way, so it's disabled. Finally, about X display. It will not work with the current X server versions, because they fail trying to access the hardware directly (like iopl/ioper, mmaping /dev/mem /dev/kmem, etc). I heard X 3.3.x fb server can work and there are other alternative X servers that could also work, like XDirectFB, XGGI and probably more. I end with the short view of the monotone log (from most recent to older entries): ----------------------------------------------------------------- Regenerated my colinux extra patch: * vm core: - Add VM_CO_IO to vma flag constants - Hack remap_pfn_range() to remap a physical PFN (using VM_CO_IO) - Hack unmap code to recognize VM_CO_IO pages * cofb.c: - removed unneeded operations (cofb_pan, cofb_write & cofb_read) - added dummy cofb_blank to avoid screen blanking - added cofb_mmap - code re-structure to avoid static data & excessive comments * cocon.c: Setup with "vga=COLSxROWS" as boot parameter * ioremap.c: Added panic's to check for ioremap bad usages * comouse.c: Fixed comouse driver (was broken) Changed my config to include devfs and other goodies. ----------------------------------------------------------------- * Special key sequences added (most can be done with F11, though) * Re-implemented copy/paste from/to console (copy only works for cocon) * Fixed comouse and prepare for mouse calibrate command * Redraw after 500 ms for cofb (for applications doing direct fb writes) * Support 16, 24 & 32 bpp for cofb (16 bpp will appear as grayscale) ----------------------------------------------------------------- * host driver: map video memory page table as last page of self (FIXME) * console enchancements: - Re-enable mouse messages handling - Paste to console is working again - Preliminary support for other color depths than 32 bits for cofb ----------------------------------------------------------------- * Reverted to old way of extra patches as "-p1" * Regenerated extra kernel patch: - Removed debug printk's from cocon.c - Converted cooperative_video.h to UNIX format ----------------------------------------------------------------- * Converted files from DOS to Unix format ----------------------------------------------------------------- * Removed "my_config" from the patch/linux-nlucas.patch and added it as conf/linux-nlucas-config. ----------------------------------------------------------------- * Regenerated my linux patch (to be applied after colinux patch) * Use "video=cofb:640x480x32" to define the cofb size (only 32 bpp supported) * Use "video=cofb:off" to disable cofb on boot ----------------------------------------------------------------- * Add "video_mem" to command line options parsing. * Fix a bug on video mode change logic. ----------------------------------------------------------------- First part of the shared video memory implementation for cocon and cofb. The base is all implemented, but a few things got broken, like mouse support and copy/paste. ----------------------------------------------------------------- (forgot to commit the linux head.cpp file in the last changelog) ----------------------------------------------------------------- colinux-console-fltk: * Fixed garbage characters in linux/user/console/head.cpp, but didn't compiled to make sure the linux version compiles now * Added a nice colinux 3D logo image to the "About" box * Removed confirmation on exit if no instance attached * Replaced "delete this" with the 1.1.6 way of "Fl::delete_widget(this)" ----------------------------------------------------------------- Linux extra patch: * cocon.c: Fixed returning a value on a void function; * cocon.c: some 80 columns limit fixes * cocon.c: code cleanup ----------------------------------------------------------------- * Fixed the appearance of the FLTK help screen for any non-FLTK parameter * Fixed a lot of harmeless warnings during compilation with -Wall ----------------------------------------------------------------- * Add patch/linux-nlucas.patch. It includes the following patches: - virtual mouse driver for colinux implemented; - CO_LINUX_MESSAGE_POWER_SHUTDOWN implementation; - arch/i386/kernel/sysenter.c: fix kernel compile warning; - cocon.c: cocon_set_font implementation; - cocon.c: cocon_scrolldelta fix; - cocon.c: code cleanup. ----------------------------------------------------------------- * Correction to earlier "make clean" fix. Add "-f" to ignore errors. ----------------------------------------------------------------- * "make clean" wasn't removing "current" symlinks. Fixed. ----------------------------------------------------------------- * Removed linking with daemon.res for all windows executables. * Added cool 3D colinux icon (made by a friend - Xico R.) * Added console.rc & cia to make the console have a icon. ----------------------------------------------------------------- * Framebuffer like font rendering for the console (not complete, yet). * Removed widget.* files, as they were replaced by the fb_view.* files. ----------------------------------------------------------------- * The changes are so many I don't know what to say ;) * Note that this is the first patch sent. Some bugs were fixed latter. ----------------------------------------------------------------- Have fun! ~Nuno Lucas