Much appreciated, thanks.  I had actually already discovered some significant 
portion of what you explain below, which is why I'm going to hold off on the 
baby-step questions so that I can save the limited Joe Groff bandwidth that the 
universe is going to provide me for more meaty important stuff.
 > Date: Thu, 9 Aug 2012 06:26:54 -0700
> From: arc...@gmail.com
> To: factor-talk@lists.sourceforge.net
> Subject: Re: [Factor-talk] Any way of making sense of what's in the boot      
> image?
> 
> On Wed, Aug 8, 2012 at 9:56 PM, Michael Clagett <mclag...@hotmail.com> wrote:
> > Hi Joe --
> >
> > Thank you so much for your guidance.  I'm assuming that it is the
> > basis\bootstrap\image\image.factor and the core\bootstrap\primitives.factor,
> > stage1.factor and syntax.factor that you are referring to?
> >
> > One question just to help me get oriented before I go into heavy
> > head-twisting mode.  I notice that all these files have significant numbers
> > of pre-existing vocabularies that they use.  If this is what is used to
> > generate the early stage1 bootstrapping stuff, then am I correct to assume
> > that this is done from some version of factor where all this stuff has built
> > already from scratch (that would be the implication, if all these files are
> > able to use those vocabularies)?  Or is there some other mechanism at work
> > here that I should know about, and if so, is it written up anywhere that you
> > know about.
> >
> > I have just read Slava's January 2010 post on the bootstrapping mechanism,
> > so I understand the mechanism a bit better now, but am still thinking there
> > has to be some Factor system somewhere that was built without a bootstrap
> > image in order to have the vocabularies available that are used to generate
> > the bootstrapping.  Is there anything anywhere documenting that aspect of
> > the picture.  The reason I ask is that I would like to get a sense of how
> > extensive that core fundamental set of vocabularies is that is needed to
> > process the primitives and stage1 factor files.
> >
> > Here's the USING statement for primitives.factor:
> >
> > USING: alien alien.strings arrays byte-arrays generic hashtables
> > hashtables.private io io.encodings.ascii kernel math
> > math.private math.order namespaces make parser sequences strings
> > vectors words quotations assocs layouts classes classes.private
> > classes.builtin classes.singleton classes.tuple
> > classes.tuple.private kernel.private vocabs vocabs.loader
> > source-files definitions slots classes.union
> > classes.intersection classes.predicate compiler.units
> > bootstrap.image.private io.files accessors combinators ;
> > IN: bootstrap.primitives
> >
> > It's got a lot of stuff there.  Is a lot of this built in the C++ code that
> > constitutes the VM?  Or is some fundamental processing capability put into
> > place that allows the processing of factor files to build these
> > vocabularies?  And if so, is the factor source used also included in the
> > downloaded platform?  Or was this a special primordial code base that was
> > used once and never really needed again?
> 
> Although core/bootstrap/primitives.factor is in core/, it's not
> actually loaded as-is into the boot image; it's really a script
> designed to run as part of `make-image` in the host image. All of
> those modules are loaded and run in the host image. While there of
> course had to have been a primordial Factor that could boot itself, I
> think it would be too different now to resemble current Factor.
> Factor's bootstrapping loop evolved somewhat organically.
> 
> You can tell whether a word is a C++ primitive by `see`ing it in the
> listener. Primitive words show up as `PRIMITIVE:` when prettyprinted.
> 
> At a high level, `make-image` has two stages: First, it executes
> `core/bootstrap/stage1.factor`, which runs 'bootstrap/syntax.factor`
> to transfer the basic syntax from the host image to the boot image,
> `bootstrap/primitives.factor` to set up primitive words corresponding
> to VM primitives, and a CPU-specific `basis/cpu/*/bootstrap.factor`
> script to assemble "sub-primitives" which are blobs of assembly
> language code composed by the VM's compiler. It also composes a
> startup quotation to begin the second stage of bootstrap when the boot
> image is started. Second, after the bootstrapping elements have been
> loaded, it serializes the data structures loaded by the bootstrap
> scripts into a boot image. Again, it does this without help from the
> VM, though it does borrow some knowledge of layouts from the compiler
> and other Factor libraries.
> >
> > P.S.   Incidentally, while I am on the subject, I find myself able to trace
> > through the VM startup code in Visual Studio with no problem at all, until I
> > get to the factor_vm::c_to_factor, which wraps a c-to-factor sub-primitive
> > inside of a callback stub and then invokes that function.  On both a Windows
> > 7 platform and a Windows Server 2008 platform, my Visual Studio blows up
> > when the callback address loaded into EDX is called.  Anybody ever
> > encountered this and any idea how to get around it?
> 
> Factor code doesn't follow the C calling convention so it's unlikely
> that a debugger will be able to walk a stack with Factor frames. In
> recent versions of Factor you can trigger Factor's own low-level
> debugger with ^C, which will let you backtrace and step through Factor
> frames.
> 
> -Joe
> 
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and 
> threat landscape has changed and how IT managers can respond. Discussions 
> will include endpoint security, mobile security and the latest in malware 
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
                                          
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to