From: Luca A. <luc...@em...> - 2003-09-10 07:43:14
|
Hi, > ok, I underestimate the video scroll function... it takes 1900 us sec on > a P3 celeron. Since there is some I/O involved, this long time is not completely surprising. However, most of the text output functions (as they are implemented now) are just crap, and they should be rewritten. I wanted to do that, but I never found the time (as usual ;). As you note, for example, the scroll function is implemented through _scroll, and this is just bad. If someone is going to reimplement the relevant parts of libcons, I am more than willing to commit the changes. In particular: - All the functions that support windows (I remember about _clear() and _scroll()) should be renamed to win_*(), and moved to a different file (something like wincons.c). - All the functions calling win_* functions should be reimplemented, in a simpler and optimized way. > So the ABORT 64 error with system TICK of 1000 it's normal... Yes, doing a message() inside an irq handler is a _very_ bad idea. > with one shot mode it shouldn't happen. I suggest to change the ll_timer > to skip > the abort test in case of one shot. I am willing to do this change, however... In this particular situation, the abort 64 is more than motivated even in the oneshot case. Guys, we are spending more than 1ms in the int handler!!! The kernel must complain, otherwise we are going to have a lot of funny bugs in the future... Maybe I can just change the overrun test (converting it in a test on the amount of time spent in the handler) and print a warning if things are going bad... > I modified also the scroll function: > > void _scroll(char attr,int x1,int y1,int x2,int y2) > { > register int x,y; > WORD xattr = attr << 8,w; > LIN_ADDR v = (LIN_ADDR)(0xB8000 + active_page*(2*PAGE_SIZE)); > > for (y = y1+1; y <= y2; y++) > for (x = x1; x <= x2; x++) { > w = lmempeekw((LIN_ADDR)(v + 2*(y*cons_columns+x))); > lmempokew((LIN_ADDR)(v + 2*((y-1)*cons_columns+x)),w); > } > for (x = x1; x <= x2; x++) > lmempokew((LIN_ADDR)(v + 2*((y-1)*cons_columns+x)),xattr); > } > > //#define OPTIMIZED > #ifdef OPTIMIZED > > void scroll(void) > { > > int x; > WORD xattr = bios_attr << 8; > LIN_ADDR v = (LIN_ADDR)(0xB8000 + active_page*(2*PAGE_SIZE)); > > memcpy((LIN_ADDR)(v), > (LIN_ADDR)(v + 2*cons_columns), > cons_columns*(cons_rows-1)*2); Uhmmm... Maybe memmove()? The two memory areas are overlapping... Ok, since dest < src memcpy() works well, but memmove() would be safer... Can you measure any performance difference if you use memmove? Luca -- _____________________________________________________________________________ Copy this in your signature, if you think it is important: N O W A R ! ! ! -- Email.it, the professional e-mail, gratis per te: http://www.email.it/f Sponsor: Conto Arancio: facile aprirlo, difficile rinunciarci. Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=663&d=10-9 |