This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Last revision Both sides next revision | ||
developersguide:rebuildingsystem [2015/08/08 22:13] jeanbaptisteboric add note to point to cross-compiling if necessary |
developersguide:rebuildingsystem [2015/08/08 22:35] jeanbaptisteboric [Rebuilding World] add link to track current |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Rebuilding the System ====== | ||
+ | |||
+ | <div round info> | ||
+ | **Note:** | ||
+ | |||
+ | This is for building MINIX from within MINIX. To cross-compile MINIX from another Unix-like system, [[.:crosscompiling|check this page]] instead. | ||
+ | </div> | ||
+ | |||
+ | ===== Rebuilding World ===== | ||
+ | The easiest way is to execute ''make build''. It will rebuild and install the operating system, as well as all the utilities. | ||
+ | |||
+ | Supposing you [[.:trackingcurrent|have the MINIX source code]] under the ''/usr/src'' directory, these commands | ||
+ | |||
+ | <code> | ||
+ | $ su | ||
+ | # cd /usr/src | ||
+ | # make build | ||
+ | </code> | ||
+ | |||
+ | will create the necessary directories, proceed to install the new includes, create the necessary //.depend// files then build and install the new libraries; and then, create the necessary //.depend// files then build and install the commands and the system (servers, drivers, and kernel), and finally install it as a new image ready for reboot. | ||
+ | |||
+ | ''make build'' does nothing with configuration (///etc//) files. Sometimes, it might be necessary to get new or updated ///etc// files. There is no automated procedure for that, though. Compare files in //src/etc// and ///etc//, and see if any updates have happened. Especially, an outdated ///etc/system.conf// (or ///etc/drivers.conf//) file can cause all sorts of problems. | ||
+ | |||
+ | In some instances, some necessary commands will have to be updated before, in order to make the new compiling work. Therefore, if ''make build'' fails unexpectedly, revise the ''docs/UPDATING'' document for instructions along the lines of running ''make -C usr.bin/foobar && make -C usr.bin/foobar install''. Then, ''make build'' again. | ||
+ | |||
+ | ===== Rebuilding the Kernel Only ===== | ||
+ | <!> In general, you should follow the process in "Rebuilding World". | ||
+ | |||
+ | <code> | ||
+ | $ su | ||
+ | # cd /usr/src/releasetools # this directory contains tools that make creating and installing the kernel easier | ||
+ | # make hdboot # this installs the kernel to your hard disk | ||
+ | </code> | ||
+ | |||
+ | ==== Other Build Targets ==== | ||
+ | Type | ||
+ | |||
+ | <code> | ||
+ | $ cd /usr/src/releasetools | ||
+ | $ make | ||
+ | </code> | ||
+ | to see the various options available. | ||
+ | |||
+ | ===== Building and booting SMP ===== | ||
+ | |||
+ | <div round important> | ||
+ | **These instructions need revisiting and checking.** | ||
+ | </div> | ||
+ | |||
+ | To rebuild SMP version of Minix set the following environment variables and follow the steps for compilation with gcc. | ||
+ | |||
+ | <code> | ||
+ | $ CONFIG_SMP=y CONFIG_MAX_CPUS=N | ||
+ | </code> | ||
+ | |||
+ | where N stands for the number of supported CPUs. If N => than the number of CPUs in your system, all CPUs are booted, if N < the number of available CPUs only N are booted. | ||
+ | |||
+ | At the moment, a SMP configured image will enable ACPI and APIC by default. These are hard requirements for SMP to work. | ||
+ | |||
+ | ===== BSD Make Documentation ===== | ||
+ | |||
+ | * http://netbsd.gw.com/cgi-bin/man-cgi?make++NetBSD-current | ||
+ | * http://www.opengroup.org/onlinepubs/009695399/utilities/make.html | ||
+ | |||
+ | Useful switches: | ||
+ | * **bmake -d m** (Debug Output: The making of each target: what target is being examined; when it was last modified; whether it is out-of-date; etc) | ||
+ | * **bmake -d s** (Debug Output: The application of suffix-transformation rules.) | ||
+ | * **bmake -n** (Display commands that would be executed, but don't actually run them.) | ||