This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Video mode code / eCos demo
- From: davidw at dedasys dot com (David N. Welton)
- To: "Kumanan" <kumanan at mindless dot com>
- Cc: ecos-discuss at sources dot redhat dot com
- Date: 11 Aug 2003 18:29:04 +0200
- Subject: Re: [ECOS] Video mode code / eCos demo
- References: <87he4rapd9.fsf@dedasys.com> <m37k5keblb.fsf@miso.calivar.com><87llu01dka.fsf@dedasys.com> <005001c36017$94a9dbe0$302aa8c0@Kummuter>
- Supersedes: <87r83syz1b.fsf@dedasys.com>
"Kumanan" <kumanan@mindless.com> writes:
> Hi David,
> Hope you don't mind me emailing directly.
Well, the list is almost always better, because 1) other people can
answer before I can 2) they can make sure my answer is right and 3)
other people can find the conversation in the archives.
> Just a quick question: In your demo are you using MicroWindows for
> framebuffer, or are you setting the video mode directly via ints?
Doing everything directly via ints and a direct address.
/* eCos puts the information we need here. */
info_block = (struct VBESVGAInfoBlock*) 0x000A0000;
current_mode = (struct VBEModeInfoBlock*) 0x000A0200;
typedef struct screen_info {
unsigned char *base_buf;
int width;
int height;
int bpp;
int scanline;
} screen_info;
get_screen_info(screen_info *si)
{
/* This is screen information. */
si->base_buf = (unsigned char*) current_mode->physical_base_ptr;
si->scanline = info_block->version >= 0x0300
? current_mode->linear_bytes_per_scanline :
current_mode->bytes_per_scanline;
si->bpp = current_mode->bits_per_pixel / 8;
si->width = current_mode->x_resolution;
si->height = current_mode->y_resolution;
}
> All I want to do is switch my platform to linear 640x480, 16bit mode
> and then punch pixels. I'd like to avoid bringing in a large library
> just to do that. (Of course, I have not played with MW so I could be
> way off in my estimate of how big I think it is :)
You want to look at gfx.c distributed with the eCos sources, and also
this:
cdl_option CYGNUM_HAL_I386_PC_STARTUP_VIDEO_MODE {
# Flavor: booldata
user_value 1 0x112
# value_source user
# Default value: 0 0
# Requires: !CYGSEM_HAL_I386_PC_DIAG_SCREEN
# CYGSEM_HAL_I386_PC_DIAG_SCREEN == 0
# --> 1
};
be sure to use (0x4000 | your_selected_mode) (or whatever mode -
search for 'VBE modes 0x115' or something on google) to do linear
addressing!
--
David N. Welton
Consulting: http://www.dedasys.com/
Personal: http://www.dedasys.com/davidw/
Free Software: http://www.dedasys.com/freesoftware/
Apache Tcl: http://tcl.apache.org/
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss