From: Paulo Marques <pmarques@grupopie.com>
To: adaplas@pol.net
Cc: linux-fbdev-devel@lists.sourceforge.net,
Kendall Bennett <KendallB@scitechsoft.com>,
Helge Hafting <helgehaf@aitel.hist.no>,
linux-kernel@vger.kernel.org,
penguinppc-team@lists.penguinppc.org,
linuxconsole-dev@lists.sourceforge.net
Subject: Re: [Linux-fbdev-devel] Re: Generic VESA framebuffer driver and Video card BOOT?
Date: Tue, 26 Oct 2004 12:14:04 +0100 [thread overview]
Message-ID: <417E317C.2020703@grupopie.com> (raw)
In-Reply-To: <200410160841.08441.adaplas@hotpop.com>
Antonino A. Daplas wrote:
> On Saturday 16 October 2004 06:12, Kendall Bennett wrote:
>
>>Helge Hafting <helgehaf@aitel.hist.no> wrote:
>>
>>>On Fri, Oct 15, 2004 at 11:36:04AM -0700, Kendall Bennett wrote:
>>>
>>>>Helge Hafting <helgehaf@aitel.hist.no> wrote:
>>>
>>>That's fine. What I meant, was please make it independent of the
>>>VESA framebuffer driver, because one might want to use an
>>>acellerated driver when one is available.
>>
>>Oh, it already is. The VESA driver is not actually done yet so the only
>>drivers using VideoBoot right now are the accelerated ones ;-)
>>
>
>
> If these get in (emulator with/without the video boot), I'm willing to
> modify the vesafb driver.
Well, I played with the emulator last night to see if I could reduce the
code size, so that it would be easier to make it to the official kernel.
I only took ops.c and did some transformations, like using a single
function to make several operations based on the opcode, instead of a
separate function for each opcode, etc.[1]
This is the result. Before:
Size of stripped libx86emu.a: ~74kb
ops.c source code lines: 11682
ops.o .text size: 36136
ops.o .data: 1312
After:
Size of stripped libx86emu.a: ~57kb
ops.c source code lines: 5908
ops.o .text size: 19320
ops.o .data: 1280
If the same treatment is applied to ops2.c and prim_ops.c, I believe it
would be possible to have a functional emulator for about 32kb of kernel
code size, which seems pretty reasonable to me and could solve a lot of
problems.
The decrease in source code size also helps maintenance, since there is
not so much repeated code has it was before.
Of course, these changes are optimizing the emulator for code size, and
not execution speed. I haven't done any benchmarks to see if there is a
noticeable difference in speed.
[1] The worst offenders were actually constructions like:
FETCH_DECODE_MODRM(mod, rh, rl);
switch (mod) {
case 0:
...<some code>
addr = decode_rm00_address(rl);
...<some more code>
break;
case 1:
...<exactly the same code as above>
addr = decode_rm01_address(rl);
...<exactly the same code as above>
break;
case 2:
...<exactly the same code as above>
addr = decode_rm10_address(rl);
...<exactly the same code as above>
break;
case 3:
<diferent code to handle register-register ops>
break;
}
This could be easily changed to:
FETCH_DECODE_MODRM(mod, rh, rl);
if (mod < 3) {
...<some code>
addr = decode_rmXX_address(mod, rl);
...<some more code>
} else {
<diferent code to handle register-register ops>
}
simply by making a new decode_rmXX_address function that handles the mod
parameter. There were more than 20 of these, and some of them were
pretty big.
--
Paulo Marques - www.grupopie.com
All that is necessary for the triumph of evil is that good men do nothing.
Edmund Burke (1729 - 1797)
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
next prev parent reply other threads:[~2004-10-26 11:14 UTC|newest]
Thread overview: 74+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-14 19:02 Generic VESA framebuffer driver and Video card BOOT? Kendall Bennett
2004-10-14 19:59 ` Zachary Smith
2004-10-15 23:36 ` Ian Romanick
2004-10-14 20:48 ` Zachary Smith
2004-10-15 18:05 ` Kendall Bennett
2004-10-15 18:55 ` Zachary Smith
2004-10-15 19:18 ` Geert Uytterhoeven
2004-10-15 22:22 ` Kendall Bennett
2004-10-15 0:27 ` [Linux-fbdev-devel] " Antonino A. Daplas
2004-10-15 18:36 ` Kendall Bennett
2004-10-15 21:51 ` Antonino A. Daplas
2004-10-15 23:20 ` Jon Smirl
2004-10-15 23:51 ` Kendall Bennett
2004-10-15 23:58 ` Jon Smirl
2004-10-19 21:15 ` Pavel Machek
2004-10-16 1:50 ` Antonino A. Daplas
2004-10-16 2:03 ` Jon Smirl
2004-10-18 19:34 ` Kendall Bennett
2004-10-18 20:34 ` Richard Smith
2004-10-18 20:47 ` [Linux-fbdev-devel] " Kendall Bennett
2004-10-18 21:04 ` Richard Smith
2004-10-18 21:16 ` Jon Smirl
2004-10-18 22:34 ` Richard Smith
2004-10-18 23:28 ` [Linux-fbdev-devel] " Jon Smirl
2004-10-19 0:18 ` Richard Smith
2004-10-19 0:55 ` [Linux-fbdev-devel] " Kendall Bennett
2004-10-19 1:39 ` Richard Smith
2004-10-19 17:54 ` Kendall Bennett
2004-10-19 21:48 ` [Linux-fbdev-devel] " Pavel Machek
2004-10-20 17:01 ` Kendall Bennett
2004-10-20 19:08 ` [Linux-fbdev-devel] " Pavel Machek
2004-10-21 19:36 ` Kendall Bennett
2004-10-19 21:42 ` [Linux-fbdev-devel] " Pavel Machek
2004-10-15 12:05 ` Gerd Knorr
2004-10-15 12:38 ` Geert Uytterhoeven
2004-10-15 12:45 ` Alan Cox
2004-10-19 21:54 ` Pavel Machek
2004-10-15 13:13 ` Gerd Knorr
2004-10-17 12:07 ` Martin Waitz
2004-10-18 8:36 ` Gerd Knorr
2004-10-18 11:39 ` [Linux-fbdev-devel] " Martin Waitz
2004-10-18 12:10 ` Gerd Knorr
2004-10-18 20:21 ` [Linux-fbdev-devel] " Helge Hafting
2004-10-18 20:42 ` Oliver Neukum
2004-10-19 16:57 ` Martin Waitz
2004-10-15 18:29 ` Venkatesh Pallipadi
2004-10-16 9:01 ` Nigel Cunningham
2004-10-15 18:36 ` [Linux-fbdev-devel] " Kendall Bennett
2004-10-15 13:48 ` Helge Hafting
2004-10-15 18:36 ` Kendall Bennett
2004-10-15 21:44 ` Helge Hafting
2004-10-15 22:12 ` Kendall Bennett
2004-10-16 0:41 ` [Linux-fbdev-devel] " Antonino A. Daplas
2004-10-26 11:14 ` Paulo Marques [this message]
2004-10-27 1:58 ` Kendall Bennett
2004-10-27 11:11 ` Paulo Marques
2004-10-27 19:52 ` Kendall Bennett
2004-10-15 21:51 ` Antonino A. Daplas
2004-10-16 17:44 ` Jon Smirl
2004-10-18 19:34 ` Kendall Bennett
2004-10-19 21:00 ` Pavel Machek
2004-10-19 21:11 ` Pavel Machek
2004-10-20 17:01 ` Kendall Bennett
2004-10-20 17:31 ` [Linux-fbdev-devel] " Pavel Machek
2004-10-20 18:44 ` Kendall Bennett
2004-10-20 19:10 ` [Linux-fbdev-devel] " Pavel Machek
2004-10-21 19:36 ` Kendall Bennett
2004-10-21 20:47 ` [Linux-fbdev-devel] " Richard Smith
-- strict thread matches above, loose matches on Subject: below --
2004-10-21 22:28 Pallipadi, Venkatesh
2004-10-21 23:00 ` Pavel Machek
2004-10-21 23:10 Pallipadi, Venkatesh
2004-10-21 23:23 ` Pavel Machek
2004-10-21 23:44 Pallipadi, Venkatesh
2004-10-22 12:57 ` Stefan Dösinger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=417E317C.2020703@grupopie.com \
--to=pmarques@grupopie.com \
--cc=KendallB@scitechsoft.com \
--cc=adaplas@pol.net \
--cc=helgehaf@aitel.hist.no \
--cc=linux-fbdev-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxconsole-dev@lists.sourceforge.net \
--cc=penguinppc-team@lists.penguinppc.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).