views:

93

answers:

3

Programs like page defrag by sysinternals or the chkdsk utility that run on startup. Please enlighten me. What kind of programming language do they use for these kinds of operations.

A: 

This is more a function of the operating system than programming language.

For example, on Windows, these types of programs often install as a service. A separate program is often run as the user, and set (via the registry) to start on login, in order to interact with the service.

Reed Copsey
Services run much later, after the system is mostly up and running.
Richard
@Richard: True. Services will startup basically after the system is booted, but I wouldn't call this "much later" - since there isn't a lot at the kernel level that's loaded nowadays...
Reed Copsey
+2  A: 

They need to work with a specific boot time version of the kernel API, hence C or C++ is the usual language.

There is brief coverage of this in "Windows Internals", but nothing like enough to write such a utility.

Richard
Ah... +1 I thought he was just talking about running something when a user logs on, not at the pre-boot type...
Earlz
+2  A: 

What usually happens is that the developer creates a booter loader that they load on storage device (such as HDD, CD/DVD, USB, etc).

The bootloader has (if I remember correctly, it's been over 8 years since I did this) 512K address to point to a startup register (usually 08h). That 512K address will store your address to your environment variables, startup address, etc.

The developer then writes a program and sets his main method to point to the startup boot address (usually 08h but that is not standard, it is vendor specific) so that when the bootloader points to the startup address, the program connected to the startup address is booted and run.

Language, hardcore C/C++/Assembly (or Pascal since it is capable of doing so).

The Elite Gentleman