Trying to figure out boot process

All development related issues welcome

Moderator: Moderator Team

Post Reply
paul
Posts: 48
Joined: Tue Jul 10, 2007 5:58 am

Trying to figure out boot process

Post by paul »

Well, I look a bit at the code, and try to figure out a bit more how things... boot.
First you need a bootsect, and there are many depending of where it is put:
http://svn.reactos.org/svn/reactos/trun ... /bootsect/

I believe the role of bootsect is to load freeldr.sys.
FreeLoader role seems to be to load the kernel, and give it a list of drivers to load.
FreeLoader is the program that, by reading .ini files, let you choose the exact operating system to start:
Reactos
Reactos (Debug)
etc.

Now there is mostly two kind of boot (boottype) that can be found in .ini files: ReactOSSetup and Windows2003
You can look at the different .ini files in http://svn.reactos.org/svn/reactos/trun ... /bootdata/
http://svn.reactos.org/svn/reactos/trun ... i?view=log
http://svn.reactos.org/svn/reactos/trun ... iew=markup
And the code that manage that http://svn.reactos.org/svn/reactos/trun ... iew=markup

It is already there that things began to be confused.
How does it decide if it is a stage 1 setup (choose the filesystem, directory and copy the files for stage 2).
Or a stage 2: (What is your name? What is the administrator password? etc.)

It seems stage 1 reside in usetup (text-mode) at: http://svn.reactos.org/svn/reactos/trun ... up/usetup/
It is unclear yet how it get called.
There is also http://svn.reactos.org/svn/reactos/trun ... p/reactos/
which could be a graphical stage 1 setup... frankly I don't know.

Now http://svn.reactos.org/svn/reactos/trun ... tup/setup/ is what load the 2nd stage and call it.
The 2nd stage is in fact a dll: http://svn.reactos.org/svn/reactos/trun ... /syssetup/

Be it a Window boot or a Setup boot, at the end of FreeLoader, it all seems to finish in:
693 VOID
694 LoadAndBootWindowsCommon(
695 USHORT OperatingSystemVersion,
696 PLOADER_PARAMETER_BLOCK LoaderBlock,
697 LPCSTR BootOptions,
698 LPCSTR BootPath,
699 BOOLEAN Setup)
inside http://svn.reactos.org/svn/reactos/trun ... iew=markup
Which finish by giving control to the kernel... I suppose.... I have no idea in fact.

But before going by there, if it is a Setup, it probably pass by:
VOID
138 LoadReactOSSetup(IN OperatingSystemItem* OperatingSystem,
139 IN USHORT OperatingSystemVersion)
in http://svn.reactos.org/svn/reactos/trun ... iew=markup

Still need to look more at the code.

vicmarcal
Test Team
Posts: 2732
Joined: Mon Jul 07, 2008 12:35 pm

Re: Trying to figure out boot process

Post by vicmarcal »

You may use our ReactOS Developer Mailing List if you want to ask such Development questions, you can find better answers there :)

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest