home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!rocket!newshost!nation
- From: nation@dopey.sanders.lockheed.com (Robert Nation)
- Newsgroups: comp.os.linux
- Subject: More on big cursors
- Message-ID: <NATION.92Dec22085219@dopey.sanders.lockheed.com>
- Date: 22 Dec 92 13:52:19 GMT
- Sender: news@rocket.sanders.lockheed.com
- Distribution: comp.os.linux
- Organization: Lockheed Sanders, Inc.
- Lines: 67
-
-
- After seeing Ed Carp's (I think) message about wimpy cursors, I
- thought that big cursors were just the thing for laptops. It is very
- hard to see the underline cursor on an LCD screen. Unfortunately,
- I didn't think that patching the kernel was really the best way to fix
- the problem, particularly since some of those laptops are 386 sx's and
- it takes a year and day to recompile the kernel. So here's a little
- program which lets you change your cursor size whenever you feel like
- it
- #include <unistd.h>
- #include <stdlib.h>
-
- void outb_p(char value, unsigned short port)
- {
- __asm__ __volatile__ ("outb %%al,%%dx"
- ::"a" ((char)value),"d" ((unsigned short) port));
- }
-
- main(int argc, char **argv)
- {
- unsigned long video_port_reg, video_port_val;
- int val1,val2,top,bottom;
-
- if(argc!=4)
- {
- printf("Usage: %s cons_type top bottom\n",argv[0]);
- printf("cons_type is m for monochrome, c for color or grey-scale\n");
- printf("top is the top row of the cursorwhich is on\n");
- printf("bottom is the bottom row\n");
- printf("Example %s c 0 17 make a block cursor on 80x25 color vga\n",
- argv[0]);
- }
-
- if(argv[1][0]=='c')
- {
- video_port_reg = 0x3d4;
- video_port_val = 0x3d5;
- }
- else
- {
- video_port_reg = 0x3b4;
- video_port_val = 0x3b5;
- }
- top=atoi(argv[2]);
- bottom=atoi(argv[3]);
-
-
- val1=ioperm(video_port_reg,1,1);
-
- val2=ioperm(video_port_val,1,1);
-
- outb_p(10,video_port_reg);
- outb_p(top,video_port_val);
- outb_p(11,video_port_reg);
- outb_p(bottom,video_port_val);
- }
-
- I called the program cursor_size and put in /bin or /usr/bin. You need
- to make it setuid root if you want to be able to use it as a regular
- user. I put the line in my rc.local "cursor_size c 0 17" which makes a
- full block cursor on an 80x85 color VGA screen. the "c" says to use a
- color (or greyscale LCD) screen, instead of a mono screen, for which
- you would use "m". 0 and 17 are the cursor extents, in rows.
-
- Hope someone finds this useful,
- Rob Nation
- nation@rocket.sanders.lockheed.com
-