Re: low level graphics
- From: "Lew Pitcher" <lpitcher@xxxxxxxxxxxx>
- Date: 22 Aug 2006 12:01:58 -0700
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
dave frost wrote:
Ive found a lot of material on the net about asm progrmaming in mode
13h, but its all in dos, a lot like this:
;Change the video mode to 13h
xor ah, ah
mov al, 13h
int 10h
;Prepare for writing to the video buffer
mov di, 0a000h
mov es, di
xor di, di
Now im sure this would compile under linux, but i expect id get a seg
fault or something due to the video memory not being in my process
memory space, correct ?
Correct.
Those assembly snippets are usually written for a "naked PC" running
MSDOS, where userspace programs have direct access to all the hardware.
In Linux (and even in any Windows based on NT, including 2K and XP)
userspace programs don't get such access and this sort of coding would
fail.
which means i would write a kernel driver
correct ?
Not necessarily. The kernel already has the smarts to let a properly
coded user program get at the video system. It just doesn't let user
programs get at the bare metal. You can
- - use X verbs to talk to an X server which will take care of the
lowest level display
management (this include OpenGL to get at the real low level), or
- - use a library like the svgalib to permit your program access to
primative
drawing actions on a VGA display
also im interested in how the video memory is laid out in
other modes, so i could do say 1280x1024 in the 18M colours etc.
You /really/ don't want to know that. Actually, video memory doesn't
change between Linux and Windows (it's a hardware thing, after all),
only access to it changes. You /really/ want to stick with the
available tools rather than trying to go off on your own (at least,
with the level of knowledge you have at the moment).
But, /if/ you do want to persist, get a good book on video hardware for
the PC (one that discusses the inner workings of video memory, GPUs,
etc) and read it. If you are kernel-hacker enough, you should be able
to put together a video-interface driver that does what you are looking
for.
Im quite keen to do some of this sort of progranmming so if anyone can
give me some pointers that would be great.
Start small and simple.
Don't proceed until you understand what you've done already.
Build towards your goal, rather than trying to jump directly to it.
Learn what the available tools are (OpenGL, X, svgalib, etc)
Learn hardware
Learn kernel development
Learn driver development
That's all I can think of for now
HTH
- --
Lew Pitcher
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (MingW32) - WinPT 0.11.12
iD8DBQFE61SUagVFX4UWr64RAhyKAJ40WnTq5UGv7Gm+MDgEzf7OtDk6pgCfSsOX
zajjG8uz9GrMmNWQr7zKnZg=
=W8/Y
-----END PGP SIGNATURE-----
.
- Follow-Ups:
- Re: low level graphics
- From: dave frost
- Re: low level graphics
- References:
- low level graphics
- From: dave frost
- low level graphics
- Prev by Date: Re: IDE for Linux with good code completion
- Next by Date: Re: IDE for Linux with good code completion
- Previous by thread: low level graphics
- Next by thread: Re: low level graphics
- Index(es):
Relevant Pages
|