Skip to content

Commit

Permalink
Renamed chk/fre to dbg/rel.
Browse files Browse the repository at this point in the history
I think this will be more obvious to most people.
  • Loading branch information
evangreen committed Oct 3, 2016
1 parent 6532f23 commit 75435f3
Show file tree
Hide file tree
Showing 18 changed files with 46 additions and 46 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ The Minoca OS build environment is keyed off of a few environment variables you'
- `SRCROOT` - Contains the absolute path to the base source directory. This respository is expected to be in a directory called `os` inside `SRCROOT`. If the third-party or tools repositories are present, they should be in directories called `third-party` and `tools` respectively underneath `SRCROOT`. For example, if you had checked out this repository into `~/src/os`, then in your shell you'd run `export SRCROOT=~/src`.
- `ARCH` - Contains the architecture to build Minoca OS for (aka the target architecture). Valid values are `armv6`, `armv7`, and `x86`.
- `VARIANT` - Contains the architecture variant, if any. Leave this unset most of the time. Currently the only valid value is `q` for the `x86` architecture, which builds for the Intel Quark.
- `DEBUG` - Describes whether to build Minoca OS for debugging or release. Valid values are `chk` for debug or `fre` for release. We always build `chk`.
- `DEBUG` - Describes whether to build Minoca OS for debugging or release. Valid values are `dbg` for debug or `rel` for release. We always build `dbg`.
- `PATH` - You'll need to have `$SRCROOT/$ARCH$VARIANT$DEBUG/tools/bin` your path to build successfully.

### Prerequisites
To build Minoca OS you'll need a Minoca-specific toolchain for the particular architecture you're building. Prebuilt toolchains can be found [here](https://www.minocacorp.com/download/). If you want to build the toolchain from sources, you'll need to check out the [third-party](https://github.com/minoca/third-party) repository and run "make tools" in there.
> Note: If you want to build your own toolchain on Windows, you may find the [tools](https://github.com/minoca/tools) repository helpful, as it contains a native MinGW compiler, make, and other tools needed to bootstrap a toolchain on Windows.
### Build
Run `make` to build the OS for the particular architecture you've supplied. Parallel make is supported. The final output of the build will be several .img files located in `$SRCROOT/$ARCH$VARIANT$DEBUG/bin/*.img`. For example, the PC image is usually located at `$SRCROOT/x86chk/bin/pc.img`. This is a raw hard disk file that can be applied directly to a hard drive or USB stick to boot Minoca OS. The image `install.img` is a generic installation archive that the `msetup` tool can use to create new Minoca OS installations on target disks or partitions.
Run `make` to build the OS for the particular architecture you've supplied. Parallel make is supported. The final output of the build will be several .img files located in `$SRCROOT/$ARCH$VARIANT$DEBUG/bin/*.img`. For example, the PC image is usually located at `$SRCROOT/x86dbg/bin/pc.img`. This is a raw hard disk file that can be applied directly to a hard drive or USB stick to boot Minoca OS. The image `install.img` is a generic installation archive that the `msetup` tool can use to create new Minoca OS installations on target disks or partitions.

Object files are generated in `$SRCROOT/$ARCH$VARIANT$DEBUG/obj/os`. You can run `make clean`, or simply delete this directory, to cause the os repository to completely rebuild. Alternatively, you can run `make wipe` to delete all generated files, including the third-party tools you built or downloaded. Running `make wipe` simply deletes `$SRCROOT/$ARCH$VARIANT$DEBUG/`. We usually stick to `make clean` since `make wipe` requires a complete rebuild of the toolchain.

Expand Down
2 changes: 1 addition & 1 deletion bochsrc.bxrc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ata0: enabled=1, ioaddr1=0x1f0, ioaddr2=0x3f0, irq=14
ata1: enabled=1, ioaddr1=0x170, ioaddr2=0x370, irq=15
ata2: enabled=0
ata3: enabled=0
ata0-master: type=disk, path=$SRCROOT/x86chk/bin/pc.img, mode=flat
ata0-master: type=disk, path=$SRCROOT/x86dbg/bin/pc.img, mode=flat
parport1: enabled=1, file=""
parport2: enabled=0
#com1: enabled=1, mode=socket-server, dev=localhost:8888
Expand Down
4 changes: 2 additions & 2 deletions boot/lib/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ Module Name:

#ifdef DEBUG

#define VERSION_DEBUG SystemBuildChecked
#define VERSION_DEBUG SystemBuildDebug

#else

#define VERSION_DEBUG SystemBuildFree
#define VERSION_DEBUG SystemBuildRelease

#endif

Expand Down
2 changes: 1 addition & 1 deletion images/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ INSTALL_IMAGE := $(BINROOT)/install.img

IMAGES = $(INSTALL_IMAGE)

ifeq ($(DEBUG),chk)
ifneq ($(DEBUG),rel)
MSETUP_DEBUG := -D
endif

Expand Down
4 changes: 2 additions & 2 deletions include/minoca/lib/rtl.h
Original file line number Diff line number Diff line change
Expand Up @@ -1448,8 +1448,8 @@ typedef enum _SYSTEM_RELEASE_LEVEL {

typedef enum _SYSTEM_BUILD_DEBUG_LEVEL {
SystemBuildInvalid,
SystemBuildChecked,
SystemBuildFree,
SystemBuildDebug,
SystemBuildRelease,
SystemBuildDebugLevelCount
} SYSTEM_BUILD_DEBUG_LEVEL, *PSYSTEM_BUILD_DEBUG_LEVEL;

Expand Down
4 changes: 2 additions & 2 deletions kernel/ke/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ Module Name:

#ifdef DEBUG

#define VERSION_DEBUG SystemBuildChecked
#define VERSION_DEBUG SystemBuildDebug

#else

#define VERSION_DEBUG SystemBuildFree
#define VERSION_DEBUG SystemBuildRelease

#endif

Expand Down
8 changes: 4 additions & 4 deletions lib/rtl/base/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ PSTR RtlReleaseLevelStrings[SystemReleaseLevelCount] = {
"alpha",
"beta",
"candidate",
"release"
"final"
};

PSTR RtlBuildDebugLevelStrings[SystemBuildDebugLevelCount] = {
"INVALID",
"checked",
"free"
"debug",
"release"
};

//
Expand Down Expand Up @@ -146,7 +146,7 @@ Return Value:
}

if ((Level != SystemVersionStringComplete) &&
(VersionInformation->DebugLevel == SystemBuildFree)) {
(VersionInformation->DebugLevel == SystemBuildRelease)) {

PrintDebugLevel = FALSE;
}
Expand Down
14 changes: 7 additions & 7 deletions minoca.mk
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,10 @@ INCLUDES += $(SRCROOT)/os/include
##

CFLAGS ?= -Wall -Werror
ifeq ($(DEBUG), chk)
CFLAGS += -O1
else
ifeq ($(DEBUG),rel)
CFLAGS += -O2 -Wno-unused-but-set-variable
else
CFLAGS += -O1
endif

##
Expand All @@ -215,10 +215,10 @@ endif

EXTRA_CPPFLAGS += -I $(subst ;, -I ,$(INCLUDES))

ifeq ($(DEBUG), chk)
EXTRA_CPPFLAGS += -DDEBUG=1
else
ifeq ($(DEBUG),rel)
EXTRA_CPPFLAGS += -DNDEBUG=1
else
EXTRA_CPPFLAGS += -DDEBUG=1
endif

EXTRA_CPPFLAGS_FOR_BUILD := $(EXTRA_CPPFLAGS)
Expand Down Expand Up @@ -319,7 +319,7 @@ override STRIP = $(STRIP_FOR_BUILD)
override CFLAGS = -Wall -Werror -O1
override BFD_ARCH = $(BUILD_BFD_ARCH)
override OBJ_FORMAT = $(BUILD_OBJ_FORMAT)
ifneq ($(DEBUG), chk)
ifeq ($(DEBUG),rel)
override CFLAGS += -Wno-unused-but-set-variable
endif

Expand Down
2 changes: 1 addition & 1 deletion tasks/build/install_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ cd ./bin
##

DEBUG_FLAG=''
if test x$DEBUG = xchk; then
if test "$DEBUG" != "rel"; then
DEBUG_FLAG='-D'
fi

Expand Down
2 changes: 1 addition & 1 deletion tasks/distrib/gen_bin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ if test -z "$ARCH"; then
exit 1
fi

BINROOT=$SRCROOT/${ARCH}${VARIANT}chk/bin
BINROOT=$SRCROOT/${ARCH}${VARIANT}dbg/bin
if ! test -d $BINROOT; then
echo "Error: BINROOT '$BINROOT' does not exist."
exit 1
Expand Down
6 changes: 3 additions & 3 deletions tasks/distrib/gen_inst.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ fi

mkdir "$WORKING"
for arch in x86 x86q armv7 armv6; do
BINROOT=$SRCROOT/${arch}chk/bin
BINROOT=$SRCROOT/${arch}dbg/bin
if ! [ -d $BINROOT ] ; then
continue
fi
Expand All @@ -55,8 +55,8 @@ for arch in x86 x86q armv7 armv6; do
cp -pv "$BINROOT/msetup" "$WORKING/$arch/"
fi

if [ -r "$SRCROOT/x86chk/msetup_build.exe" ]; then
cp -pv "$SRCROOT/x86chk/msetup_build.exe" "$WORKING/msetup.exe"
if [ -r "$SRCROOT/x86dbg/msetup_build.exe" ]; then
cp -pv "$SRCROOT/x86dbg/msetup_build.exe" "$WORKING/msetup.exe"
fi

done
Expand Down
2 changes: 1 addition & 1 deletion tasks/distrib/gen_plats.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ if test -z "$ARCH"; then
exit 1
fi

BINROOT=$SRCROOT/${ARCH}${VARIANT}chk/bin
BINROOT=$SRCROOT/${ARCH}${VARIANT}dbg/bin
if ! test -d $BINROOT; then
echo "Error: BINROOT '$BINROOT' does not exist."
exit 1
Expand Down
10 changes: 5 additions & 5 deletions tasks/distrib/gen_sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ if test -z "$ARCH"; then
exit 1
fi

BINROOT="$SRCROOT/${ARCH}chk/bin"
BINROOT="$SRCROOT/${ARCH}dbg/bin"
if ! test -d $BINROOT; then
echo "Error: BINROOT '$BINROOT' does not exist."
exit 1
Expand Down Expand Up @@ -384,8 +384,8 @@ around three environment variables:
determines this based on its own path.
* ARCH -- Defines the architecture to build for. This is either set to x86,
armv6 or armv7 depending on .bat file used.
* DEBUG -- Defines whether to compile with debugging checks ("chk"), or
without debugging checks ("fre"). This is set to "chk", as it matches with
* DEBUG -- Defines whether to compile with debugging checks ("dbg"), or
without debugging checks ("rel"). This is set to "dbg", as it matches with
the free edition binaries.
The various scripts make certain assumptions about the layout of directories
Expand All @@ -396,7 +396,7 @@ it:
* os -- Contains the SDK source.
* third-party (optional) -- Contains the third party source packages not
authored by Minoca.
* x86chk, x86qchk, armv7chk, armv6chk -- These are actually
* x86dbg, x86qdbg, armv7dbg, armv6dbg -- These are actually
$ARCH$VARIANT$DEBUG, and contain the build output. Each directory is
created automatically when a build for its particular architecture is
initiated. Notable directories inside of these include obj, the directory
Expand Down Expand Up @@ -428,7 +428,7 @@ for iarch in x86 armv7 armv6; do
@ECHO OFF
set REVISION=$REVISION
cmd.exe /k .\\tools\\win32\\scripts\\setenv.cmd $iarch chk
cmd.exe /k .\\tools\\win32\\scripts\\setenv.cmd $iarch dbg
_EOF
done
Expand Down
2 changes: 1 addition & 1 deletion tasks/distrib/gen_syms.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fi
mkdir "$WORKING"
OLDPWD="$PWD"
for arch in x86 x86q armv7 armv6; do
BINROOT=$SRCROOT/${arch}chk/bin
BINROOT=$SRCROOT/${arch}dbg/bin
if ! [ -d $BINROOT ] ; then
continue
fi
Expand Down
6 changes: 3 additions & 3 deletions tasks/distrib/gen_tp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ if test -z "$ARCH"; then
exit 1
fi

BINROOT=$SRCROOT/${ARCH}chk/bin
BINROOT=$SRCROOT/${ARCH}dbg/bin
if ! test -d $BINROOT; then
echo "Error: BINROOT '$BINROOT' does not exist."
exit 1
Expand Down Expand Up @@ -138,13 +138,13 @@ MinocaSDK-NNN/
Our build glue for a package generally works something like this:
* Run make in third-party/build/<package>/ (our glue).
* Our glue extracts the clean source in third-party/src/<package>.tar.gz
to x86chk/obj/third-party/<package>.src/ (x86chk may be different based
to x86dbg/obj/third-party/<package>.src/ (x86dbg may be different based
on architecture and flavor).
* The patch from third-party/build/<package>/<package>.diff is applied to
the newly copied source.
* Make then invokes third-party/build/<package>/build.sh
* The build.sh script will invoke configure, make, and make install of the
patched source in x86chk/obj/third-party/<package>/ (it's an out-of-tree
patched source in x86dbg/obj/third-party/<package>/ (it's an out-of-tree
build).
Expand Down
2 changes: 1 addition & 1 deletion tasks/osbuilder/build_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def main(argv):
else:
os.environ['ARCH'] = arch

os.environ['DEBUG'] = 'chk'
os.environ['DEBUG'] = 'dbg'
run(binroot, "sh '%s'" % image_script)

##
Expand Down
14 changes: 7 additions & 7 deletions tasks/schedules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@ Schedule Name Task Name Node
================================================================================
Windows Pilot Windows Pilot Windows Pilot Machine
Windows Compile x86 chk Windows Compile Windows Pilot Machine
ARCH=x86 DEBUG=chk
ARCH=x86 DEBUG=dbg
Windows Compile armv7 chk Windows Compile Windows Pilot Machine
ARCH=armv7 DEBUG=chk
ARCH=armv7 DEBUG=dbg
Windows Compile armv6 chk Windows Compile Windows Pilot Machine
ARCH=armv6 DEBUG=chk
ARCH=armv6 DEBUG=dbg
Native Pilot x86 Native Pilot Native Pilot Machine (x86)
ARCH=x86 DEBUG=chk
ARCH=x86 DEBUG=dbg
Native Pilot x86q Native Pilot Native Pilot Machine (x86)
ARCH=x86 DEBUG=chk VARIANT=q
ARCH=x86 DEBUG=dbg VARIANT=q
Native Pilot armv7 Native Pilot Native Pilot Machine (armv7)
ARCH=armv7 DEBUG=chk
ARCH=armv7 DEBUG=dbg
Native Pilot armv6 Native Pilot Native Pilot Machine (armv6)
ARCH=armv6 DEBUG=chk
ARCH=armv6 DEBUG=dbg
Native Test x86 Native Test x86 test machines
Native Test x86q Native Test Galileo test machines
Native Test armv7 Native Test armv7 test machines
Expand Down
4 changes: 2 additions & 2 deletions uefi/core/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ Module Name:

#ifdef DEBUG

#define VERSION_DEBUG SystemBuildChecked
#define VERSION_DEBUG SystemBuildDebug

#else

#define VERSION_DEBUG SystemBuildFree
#define VERSION_DEBUG SystemBuildRelease

#endif

Expand Down

0 comments on commit 75435f3

Please sign in to comment.