[ANN] Bootstrapped kernel image
Pavel Krivanek
squeak1 at continentalbrno.cz
Sun Oct 30 18:20:25 UTC 2005
Hi Klaus,
first of all you need clean image that contains no obsolete classes and
can create set of mirrors without errors. You may find little problems,
for example AsyncFile class contains class variable named Error that
collides with a class name etc.
If you can create mirrors, try to carry out bootstrapping - revert
mirrors. That can show next inconsistencies in sources because it does
deep recompilation of whole image. You don’t need to do this from
emergency console because it isn’t destructive operation. Only changes
file is then much larger. That means that this process can be used for
creating of every image, not only extremely small ones. Of course the
source and bootstrapped image has to be similar, you cannot create 3.8
image from 3.7 because of deep changes related to m17n integration.
When you can bootstrap original image to itself, you may start to modify
it. E.g. if you want to remove a class, take its original, find all
class references to it, select all references from mirrors (classes that
starts with prefix Xxx) and then correct manually all "infected"
methods. That means that you modify them or check senders of them (or
senders of senders of senders of them) and remove them. Remember that
removed class has to have no subclasses.
Of course you will not remove class by class. In this case you may use
transcript output from final recompilation of bootstrapped image.
Compiler writes undeclared references to transcript. That’s why the list
of recompiled classes begins with tab. Warnings of compiler are easily
visible.
Obsolete classes are very important indicator of image consistency. If
you reach the state in that your image will not have undeclared
references in source codes of methods, most of obsolete classes will
disappear. But there will be still forgotten references to instances of
obsolete classes in system dictionary and some class variables. You have
to find them using inspector or pointersTo: method.
Thanks mirrors you may modify system radically. Of course you must not
break compiler. Some of classes have unloading code that may be dangerous.
If you know what you want, shrinking is not difficult. It’s time
consuming and little boring operation. If you want to file out mirrors,
the method addMirrorsToCurrentChangeSet can be helpful. The change set
file with mirrors should not contain the section with initialization of
classes.
Any questions?
-- Pavel
> Hi Pavel,
>
> I looked into Mirrors.1.cs and Bootstrap.st, how did you manage
> "mirrors are modified so they contain whole class hierarchy for new
> system. There are original classes used in code of methods."
>
> Being aware that the answer most likely is "manually", could you post
> an "abstract" so that other people (especially me) can learn from
> your experience.
>
> Thank you very much in advance.
>
> /Klaus
>
>
> On Sun, 16 Oct 2005 18:32:16 +0200, Pavel Krivanek
> <squeak1 at continentalbrno.cz> wrote:
>
>> Hi all,
>>
>> I have prepared an experimental kernel image based on Squeak 3.7.
>>
>> Properties:
>> - size: 1.3 MB
>> - no Morphic
>> - no MVC
>> - no Sound
>> - no Network
>> - no Browser, Debugger etc.
>> - no SUnit
>> - no Projects support (there’s only one default project)
>> - only necessary processes
>> - no ObsoleteClasses (consistent references in sources)
>> - single font
>> - simple console with clipboard support
>> - transcript output (with file log)
>> - transparent creation mechanism
>>
>> Download:
>> - image with changes: ftp://comtalk.net/pub/bootstrap/kernel.zip
>> - bootstrapping environment:
>> ftp://comtalk.net/pub/bootstrap/Bootstrap.zip
>> - please, can somebody place it to a new location with better
>> connectivity?
>>
>> How to prepare it:
>> - use QuiteSmall image
>> (http://www.swerlingphoto.com/squeak/QuiteSmall-3.7.zip)
>> - load Mirrors.1.cs
>> - load Bootstrap.st
>> - evaluate "Bootstrap start"
>> - in console type "Bootstrap revert"
>> - wait a while
>> - condense changes, clear transcript, save image
>>
>> How it works:
>> - for all classes in system "mirrors" are created. Mirrors are
>> classes with prefix "Xxx" that contain only class definition and
>> methods. They contain no valid references to class variables.
>> - mirrors are modified so they contain whole class hierarchy for new
>> system. There are original classes used in code of methods.
>> - initial cleanup is executed and system processes are recreated
>> - for all original classes, methods of mirrors are assigned. Methods
>> that aren’t in mirrors are removed. Then the new definition of class
>> is used.
>> - unnecessary original classes are removed
>> - mirrors are removed
>> - whole sources are recompiled
>> - additional cleanup is executed
>>
>> The console is very simple. Now it cannot simulate FillInTheBlank,
>> confirmations, user interrupt etc.
>>
>> Feel free to clean, improve and fix this image. I have to say that
>> I’m VERY tired of creation of this image now and I need a pause :-)
>>
>> -- Pavel
>>
>>
>>
>
>
>
>
>
More information about the Squeak-dev
mailing list
|