diff --git a/exp/MemManager/DEP~1.INC b/exp/MemManager/DEP~1.INC new file mode 100644 index 0000000..4560e55 --- /dev/null +++ b/exp/MemManager/DEP~1.INC @@ -0,0 +1,5 @@ +# This code depends on make tool being used +DEPFILES=$(wildcard $(addsuffix .d, ${OBJECTFILES})) +ifneq (${DEPFILES},) +include ${DEPFILES} +endif diff --git a/exp/MemManager/Makefile b/exp/MemManager/Makefile new file mode 100644 index 0000000..ec9de69 --- /dev/null +++ b/exp/MemManager/Makefile @@ -0,0 +1,128 @@ +# +# There exist several targets which are by default empty and which can be +# used for execution of your targets. These targets are usually executed +# before and after some main targets. They are: +# +# .build-pre: called before 'build' target +# .build-post: called after 'build' target +# .clean-pre: called before 'clean' target +# .clean-post: called after 'clean' target +# .clobber-pre: called before 'clobber' target +# .clobber-post: called after 'clobber' target +# .all-pre: called before 'all' target +# .all-post: called after 'all' target +# .help-pre: called before 'help' target +# .help-post: called after 'help' target +# +# Targets beginning with '.' are not intended to be called on their own. +# +# Main targets can be executed directly, and they are: +# +# build build a specific configuration +# clean remove built files from a configuration +# clobber remove all built files +# all build all configurations +# help print help mesage +# +# Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and +# .help-impl are implemented in nbproject/makefile-impl.mk. +# +# Available make variables: +# +# CND_BASEDIR base directory for relative paths +# CND_DISTDIR default top distribution directory (build artifacts) +# CND_BUILDDIR default top build directory (object files, ...) +# CONF name of current configuration +# CND_PLATFORM_${CONF} platform name (current configuration) +# CND_ARTIFACT_DIR_${CONF} directory of build artifact (current configuration) +# CND_ARTIFACT_NAME_${CONF} name of build artifact (current configuration) +# CND_ARTIFACT_PATH_${CONF} path to build artifact (current configuration) +# CND_PACKAGE_DIR_${CONF} directory of package (current configuration) +# CND_PACKAGE_NAME_${CONF} name of package (current configuration) +# CND_PACKAGE_PATH_${CONF} path to package (current configuration) +# +# NOCDDL + + +# Environment +MKDIR=mkdir +CP=cp +CCADMIN=CCadmin + + +# build +build: .build-post + +.build-pre: +# Add your pre 'build' code here... + +.build-post: .build-impl +# Add your post 'build' code here... + + +# clean +clean: .clean-post + +.clean-pre: +# Add your pre 'clean' code here... + +.clean-post: .clean-impl +# Add your post 'clean' code here... + + +# clobber +clobber: .clobber-post + +.clobber-pre: +# Add your pre 'clobber' code here... + +.clobber-post: .clobber-impl +# Add your post 'clobber' code here... + + +# all +all: .all-post + +.all-pre: +# Add your pre 'all' code here... + +.all-post: .all-impl +# Add your post 'all' code here... + + +# build tests +build-tests: .build-tests-post + +.build-tests-pre: +# Add your pre 'build-tests' code here... + +.build-tests-post: .build-tests-impl +# Add your post 'build-tests' code here... + + +# run tests +test: .test-post + +.test-pre: +# Add your pre 'test' code here... + +.test-post: .test-impl +# Add your post 'test' code here... + + +# help +help: .help-post + +.help-pre: +# Add your pre 'help' code here... + +.help-post: .help-impl +# Add your post 'help' code here... + + + +# include project implementation makefile +include nbproject/Makefile-impl.mk + +# include project make variables +include nbproject/Makefile-variables.mk diff --git a/exp/MemManager/main.c b/exp/MemManager/main.c new file mode 100644 index 0000000..73c1060 --- /dev/null +++ b/exp/MemManager/main.c @@ -0,0 +1,162 @@ +#include +#include +#include + +#include "manager.h" + +char* Commands[] = +{ + "", //0 + "hello", //1 + "exit", //2 + "params", //3 + "alloc", //4 + "free", //5 + "help", //6 + "dump", //7 + "find", //8 + "split", //9 + "concat" //10 +}; + +int CommandsCount = 11; + + +unsigned atox(char* str) +{ + char num[] = "0123456789ABCDEF"; + + int i, len = strlen(str), res=0, a; + for (i=0; i < len; i++) + { + if (str[i]>='0' && str[i]<='9') a=str[i]-'0'; + else if (str[i]>='A' && str[i]<='Z') a=10+str[i]-'A'; + else if (str[i]>='a' && str[i]<='z') a=10+str[i]-'a'; + else return res; + res = (res<<4)|a; + } + + return res; +} + + +int main() +{ + char buffer[256]; + char *command[16]; + + printf("Welcome to the console :)"); + + Install(0x100000, 0x10000); + + for(;;) + { + // Read input + printf("\n> "); + fgets(buffer, 256, stdin); + + // Process input + int i=0, len = strlen(buffer); + int cmds = 0; + while (i < len && cmds < 16) + { + while (isspace(buffer[i]) && i +#include +#include + +#include "manager.h" + +unsigned TotalMemory; + +MemoryBlock* Memory; +unsigned TotalBlocks; + +void Install(unsigned AvailableMemory, unsigned Reserved) +{ + TotalMemory = AvailableMemory; + + Memory = malloc(2*sizeof(MemoryBlock)); + Memory[0].Address = 0; + Memory[0].Length = Reserved; + Memory[0].Used = 1; + + Memory[1].Address = Reserved; + Memory[1].Length = (AvailableMemory - Reserved); + Memory[1].Used = 0; + + TotalBlocks = 2; +} + +unsigned Alloc(unsigned size) +{ + // Find a block big enough + int i; + for (i = TotalBlocks-1; i >= 0 && (Memory[i].Used || Memory[i].Length= i; k--) + Memory[k+1] = Memory[k]; + + Memory[i].Length -= size; + Memory[i+1].Address += Memory[i].Length; + + i++; TotalBlocks++; + } + + Memory[i].Length = size; + Memory[i].Used = 1; + + return Memory[i].Address; +} + + +int _bsearch(unsigned address) +{ + int i, step; + for (step = 1; step < TotalBlocks; step <<= 1); + for (i = 0; step; step >>= 1) + if (i + step < TotalBlocks && Memory[i + step].Address <= address) + i += step; + + return ((address == Memory[i].Address) ? i : -1); +} + +int Free(unsigned address) +{ + int loc=_bsearch(address), i; + if (address == 0 || loc == -1 || Memory[loc].Used==0) return -1; + + Memory[loc].Used = 0; + + if (Memory[loc-1].Used == 0) + { + Memory[loc-1].Length += Memory[loc].Length; + + for (i=loc; i TotalMemory) return -1; + + // Find the block + int i; + for (i = 0; i < TotalBlocks && address > Memory[i].Address+Memory[i].Length; i++); + + // Insert a new block in between + Memory = realloc(Memory, sizeof(MemoryBlock)*(TotalBlocks+1)); + int j; + for (j = TotalBlocks-1; j >= i; j--) + Memory[j+1] = Memory[j]; + + // Set the data + Memory[i+1].Address = address; + Memory[i].Length = address - Memory[i].Address; + Memory[i+1].Length -= Memory[i].Length; + + TotalBlocks++; + + return i; +} + +// Concatenates 'block' with the next one +void MemConcat (int block, unsigned char new_flags) +{ + Memory[block].Length += Memory[block+1].Length; + // TODO: Set flags + + int i; + for (i = TotalBlocks-2; i>block; i--) + Memory[i] = Memory[i+1]; + + Memory = realloc(Memory, sizeof(MemoryBlock)*(TotalBlocks-1)); + TotalBlocks--; +} + +void Dump() +{ + int i; + printf("Total memory: 0x%x (%u bytes)\n", TotalMemory, TotalMemory); + for (i=0; i Running $@... Configuration=$(CONF)" + "${MAKE}" -f nbproject/Makefile-${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .build-conf + + +# clean +.clean-impl: .clean-pre .validate-impl .depcheck-impl + @#echo "=> Running $@... Configuration=$(CONF)" + "${MAKE}" -f nbproject/Makefile-${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .clean-conf + + +# clobber +.clobber-impl: .clobber-pre .depcheck-impl + @#echo "=> Running $@..." + for CONF in ${ALLCONFS}; \ + do \ + "${MAKE}" -f nbproject/Makefile-$${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .clean-conf; \ + done + +# all +.all-impl: .all-pre .depcheck-impl + @#echo "=> Running $@..." + for CONF in ${ALLCONFS}; \ + do \ + "${MAKE}" -f nbproject/Makefile-$${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .build-conf; \ + done + +# build tests +.build-tests-impl: .build-impl .build-tests-pre + @#echo "=> Running $@... Configuration=$(CONF)" + "${MAKE}" -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .build-tests-conf + +# run tests +.test-impl: .build-tests-impl .test-pre + @#echo "=> Running $@... Configuration=$(CONF)" + "${MAKE}" -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .test-conf + +# dependency checking support +.depcheck-impl: + @echo "# This code depends on make tool being used" >.dep.inc + @if [ -n "${MAKE_VERSION}" ]; then \ + echo "DEPFILES=\$$(wildcard \$$(addsuffix .d, \$${OBJECTFILES}))" >>.dep.inc; \ + echo "ifneq (\$${DEPFILES},)" >>.dep.inc; \ + echo "include \$${DEPFILES}" >>.dep.inc; \ + echo "endif" >>.dep.inc; \ + else \ + echo ".KEEP_STATE:" >>.dep.inc; \ + echo ".KEEP_STATE_FILE:.make.state.\$${CONF}" >>.dep.inc; \ + fi + +# configuration validation +.validate-impl: + @if [ ! -f nbproject/Makefile-${CONF}.mk ]; \ + then \ + echo ""; \ + echo "Error: can not find the makefile for configuration '${CONF}' in project ${PROJECTNAME}"; \ + echo "See 'make help' for details."; \ + echo "Current directory: " `pwd`; \ + echo ""; \ + fi + @if [ ! -f nbproject/Makefile-${CONF}.mk ]; \ + then \ + exit 1; \ + fi + + +# help +.help-impl: .help-pre + @echo "This makefile supports the following configurations:" + @echo " ${ALLCONFS}" + @echo "" + @echo "and the following targets:" + @echo " build (default target)" + @echo " clean" + @echo " clobber" + @echo " all" + @echo " help" + @echo "" + @echo "Makefile Usage:" + @echo " make [CONF=] [SUB=no] build" + @echo " make [CONF=] [SUB=no] clean" + @echo " make [SUB=no] clobber" + @echo " make [SUB=no] all" + @echo " make help" + @echo "" + @echo "Target 'build' will build a specific configuration and, unless 'SUB=no'," + @echo " also build subprojects." + @echo "Target 'clean' will clean a specific configuration and, unless 'SUB=no'," + @echo " also clean subprojects." + @echo "Target 'clobber' will remove all built files from all configurations and," + @echo " unless 'SUB=no', also from subprojects." + @echo "Target 'all' will will build all configurations and, unless 'SUB=no'," + @echo " also build subprojects." + @echo "Target 'help' prints this message." + @echo "" + diff --git a/exp/MemManager/nbproject/Makefile-variables.mk b/exp/MemManager/nbproject/Makefile-variables.mk new file mode 100644 index 0000000..730468f --- /dev/null +++ b/exp/MemManager/nbproject/Makefile-variables.mk @@ -0,0 +1,24 @@ +# +# Generated - do not edit! +# +# NOCDDL +# +CND_BASEDIR=`pwd` +CND_BUILDDIR=build +CND_DISTDIR=dist +# Debug configuration +CND_PLATFORM_Debug=GNU-Linux-x86 +CND_ARTIFACT_DIR_Debug=dist/Debug/GNU-Linux-x86 +CND_ARTIFACT_NAME_Debug=memmanager +CND_ARTIFACT_PATH_Debug=dist/Debug/GNU-Linux-x86/memmanager +CND_PACKAGE_DIR_Debug=dist/Debug/GNU-Linux-x86/package +CND_PACKAGE_NAME_Debug=memmanager.tar +CND_PACKAGE_PATH_Debug=dist/Debug/GNU-Linux-x86/package/memmanager.tar +# Release configuration +CND_PLATFORM_Release=GNU-Linux-x86 +CND_ARTIFACT_DIR_Release=dist/Release/GNU-Linux-x86 +CND_ARTIFACT_NAME_Release=memmanager +CND_ARTIFACT_PATH_Release=dist/Release/GNU-Linux-x86/memmanager +CND_PACKAGE_DIR_Release=dist/Release/GNU-Linux-x86/package +CND_PACKAGE_NAME_Release=memmanager.tar +CND_PACKAGE_PATH_Release=dist/Release/GNU-Linux-x86/package/memmanager.tar diff --git a/exp/MemManager/nbproject/Package-Debug.bash b/exp/MemManager/nbproject/Package-Debug.bash new file mode 100644 index 0000000..4955edd --- /dev/null +++ b/exp/MemManager/nbproject/Package-Debug.bash @@ -0,0 +1,74 @@ +#!/bin/bash -x + +# +# Generated - do not edit! +# + +# Macros +TOP=`pwd` +CND_PLATFORM=GNU-Linux-x86 +CND_CONF=Debug +CND_DISTDIR=dist +NBTMPDIR=build/${CND_CONF}/${CND_PLATFORM}/tmp-packaging +TMPDIRNAME=tmp-packaging +OUTPUT_PATH=${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/memmanager +OUTPUT_BASENAME=memmanager +PACKAGE_TOP_DIR=memmanager/ + +# Functions +function checkReturnCode +{ + rc=$? + if [ $rc != 0 ] + then + exit $rc + fi +} +function makeDirectory +# $1 directory path +# $2 permission (optional) +{ + mkdir -p "$1" + checkReturnCode + if [ "$2" != "" ] + then + chmod $2 "$1" + checkReturnCode + fi +} +function copyFileToTmpDir +# $1 from-file path +# $2 to-file path +# $3 permission +{ + cp "$1" "$2" + checkReturnCode + if [ "$3" != "" ] + then + chmod $3 "$2" + checkReturnCode + fi +} + +# Setup +cd "${TOP}" +mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package +rm -rf ${NBTMPDIR} +mkdir -p ${NBTMPDIR} + +# Copy files and create directories and links +cd "${TOP}" +makeDirectory "${NBTMPDIR}/memmanager/bin" +copyFileToTmpDir "${OUTPUT_PATH}" "${NBTMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755 + + +# Generate tar file +cd "${TOP}" +rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/memmanager.tar +cd ${NBTMPDIR} +tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/memmanager.tar * +checkReturnCode + +# Cleanup +cd "${TOP}" +rm -rf ${NBTMPDIR} diff --git a/exp/MemManager/nbproject/Package-Release.bash b/exp/MemManager/nbproject/Package-Release.bash new file mode 100644 index 0000000..f9a8ca1 --- /dev/null +++ b/exp/MemManager/nbproject/Package-Release.bash @@ -0,0 +1,74 @@ +#!/bin/bash -x + +# +# Generated - do not edit! +# + +# Macros +TOP=`pwd` +CND_PLATFORM=GNU-Linux-x86 +CND_CONF=Release +CND_DISTDIR=dist +NBTMPDIR=build/${CND_CONF}/${CND_PLATFORM}/tmp-packaging +TMPDIRNAME=tmp-packaging +OUTPUT_PATH=${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/memmanager +OUTPUT_BASENAME=memmanager +PACKAGE_TOP_DIR=memmanager/ + +# Functions +function checkReturnCode +{ + rc=$? + if [ $rc != 0 ] + then + exit $rc + fi +} +function makeDirectory +# $1 directory path +# $2 permission (optional) +{ + mkdir -p "$1" + checkReturnCode + if [ "$2" != "" ] + then + chmod $2 "$1" + checkReturnCode + fi +} +function copyFileToTmpDir +# $1 from-file path +# $2 to-file path +# $3 permission +{ + cp "$1" "$2" + checkReturnCode + if [ "$3" != "" ] + then + chmod $3 "$2" + checkReturnCode + fi +} + +# Setup +cd "${TOP}" +mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package +rm -rf ${NBTMPDIR} +mkdir -p ${NBTMPDIR} + +# Copy files and create directories and links +cd "${TOP}" +makeDirectory "${NBTMPDIR}/memmanager/bin" +copyFileToTmpDir "${OUTPUT_PATH}" "${NBTMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755 + + +# Generate tar file +cd "${TOP}" +rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/memmanager.tar +cd ${NBTMPDIR} +tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/memmanager.tar * +checkReturnCode + +# Cleanup +cd "${TOP}" +rm -rf ${NBTMPDIR} diff --git a/exp/MemManager/nbproject/configurations.xml b/exp/MemManager/nbproject/configurations.xml new file mode 100644 index 0000000..6d6ea40 --- /dev/null +++ b/exp/MemManager/nbproject/configurations.xml @@ -0,0 +1,67 @@ + + + + + manager.h + + + + + main.c + manager.c + + + + + Makefile + + + Makefile + + + + localhost + GNU|GNU + 2 + + + + + + + localhost + GNU|GNU + 2 + + + + 5 + + + 5 + + + 5 + + + 5 + + + + + diff --git a/exp/MemManager/nbproject/project.xml b/exp/MemManager/nbproject/project.xml new file mode 100644 index 0000000..c9a0c51 --- /dev/null +++ b/exp/MemManager/nbproject/project.xml @@ -0,0 +1,20 @@ + + + org.netbeans.modules.cnd.makeproject + + + MemManager + 0 + c + + h + UTF-8 + + + + Debug + Release + + + + diff --git a/exp/Memtest/DEP~1.INC b/exp/Memtest/DEP~1.INC new file mode 100644 index 0000000..4560e55 --- /dev/null +++ b/exp/Memtest/DEP~1.INC @@ -0,0 +1,5 @@ +# This code depends on make tool being used +DEPFILES=$(wildcard $(addsuffix .d, ${OBJECTFILES})) +ifneq (${DEPFILES},) +include ${DEPFILES} +endif diff --git a/exp/Memtest/Makefile b/exp/Memtest/Makefile new file mode 100644 index 0000000..ec9de69 --- /dev/null +++ b/exp/Memtest/Makefile @@ -0,0 +1,128 @@ +# +# There exist several targets which are by default empty and which can be +# used for execution of your targets. These targets are usually executed +# before and after some main targets. They are: +# +# .build-pre: called before 'build' target +# .build-post: called after 'build' target +# .clean-pre: called before 'clean' target +# .clean-post: called after 'clean' target +# .clobber-pre: called before 'clobber' target +# .clobber-post: called after 'clobber' target +# .all-pre: called before 'all' target +# .all-post: called after 'all' target +# .help-pre: called before 'help' target +# .help-post: called after 'help' target +# +# Targets beginning with '.' are not intended to be called on their own. +# +# Main targets can be executed directly, and they are: +# +# build build a specific configuration +# clean remove built files from a configuration +# clobber remove all built files +# all build all configurations +# help print help mesage +# +# Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and +# .help-impl are implemented in nbproject/makefile-impl.mk. +# +# Available make variables: +# +# CND_BASEDIR base directory for relative paths +# CND_DISTDIR default top distribution directory (build artifacts) +# CND_BUILDDIR default top build directory (object files, ...) +# CONF name of current configuration +# CND_PLATFORM_${CONF} platform name (current configuration) +# CND_ARTIFACT_DIR_${CONF} directory of build artifact (current configuration) +# CND_ARTIFACT_NAME_${CONF} name of build artifact (current configuration) +# CND_ARTIFACT_PATH_${CONF} path to build artifact (current configuration) +# CND_PACKAGE_DIR_${CONF} directory of package (current configuration) +# CND_PACKAGE_NAME_${CONF} name of package (current configuration) +# CND_PACKAGE_PATH_${CONF} path to package (current configuration) +# +# NOCDDL + + +# Environment +MKDIR=mkdir +CP=cp +CCADMIN=CCadmin + + +# build +build: .build-post + +.build-pre: +# Add your pre 'build' code here... + +.build-post: .build-impl +# Add your post 'build' code here... + + +# clean +clean: .clean-post + +.clean-pre: +# Add your pre 'clean' code here... + +.clean-post: .clean-impl +# Add your post 'clean' code here... + + +# clobber +clobber: .clobber-post + +.clobber-pre: +# Add your pre 'clobber' code here... + +.clobber-post: .clobber-impl +# Add your post 'clobber' code here... + + +# all +all: .all-post + +.all-pre: +# Add your pre 'all' code here... + +.all-post: .all-impl +# Add your post 'all' code here... + + +# build tests +build-tests: .build-tests-post + +.build-tests-pre: +# Add your pre 'build-tests' code here... + +.build-tests-post: .build-tests-impl +# Add your post 'build-tests' code here... + + +# run tests +test: .test-post + +.test-pre: +# Add your pre 'test' code here... + +.test-post: .test-impl +# Add your post 'test' code here... + + +# help +help: .help-post + +.help-pre: +# Add your pre 'help' code here... + +.help-post: .help-impl +# Add your post 'help' code here... + + + +# include project implementation makefile +include nbproject/Makefile-impl.mk + +# include project make variables +include nbproject/Makefile-variables.mk diff --git a/exp/Memtest/main.c b/exp/Memtest/main.c new file mode 100644 index 0000000..b803718 --- /dev/null +++ b/exp/Memtest/main.c @@ -0,0 +1,38 @@ +/* + * File: main.c + * Author: Tiberiu + * + * Created on August 18, 2011, 11:40 AM + */ + +#include +#include + +typedef int int32; +typedef unsigned uint32; +typedef unsigned char uint8; +typedef char* string; + +uint32 ConvertStringToUInt (string buffer) +{ + int32 pos = 0; + int32 number = 0; + + while (buffer[pos] >= '0' && buffer[pos] <= '9') + { + number = number*10 + (buffer[pos] - '0'); + pos++; + + } + + return number; +} + + +int main(int argc, char** argv) { + + printf ("after conversion: %u\n", ConvertStringToUInt("41")); + + return (EXIT_SUCCESS); +} + diff --git a/exp/Memtest/nbproject/Makefile-Debug.mk b/exp/Memtest/nbproject/Makefile-Debug.mk new file mode 100644 index 0000000..c6b2c96 --- /dev/null +++ b/exp/Memtest/nbproject/Makefile-Debug.mk @@ -0,0 +1,82 @@ +# +# Generated Makefile - do not edit! +# +# Edit the Makefile in the project folder instead (../Makefile). Each target +# has a -pre and a -post target defined where you can add customized code. +# +# This makefile implements configuration specific macros and targets. + + +# Environment +MKDIR=mkdir +CP=cp +GREP=grep +NM=nm +CCADMIN=CCadmin +RANLIB=ranlib +CC=gcc.exe +CCC=g++.exe +CXX=g++.exe +FC= +AS=as.exe + +# Macros +CND_PLATFORM=MinGW-Windows +CND_CONF=Debug +CND_DISTDIR=dist + +# Include project Makefile +include Makefile + +# Object Directory +OBJECTDIR=build/${CND_CONF}/${CND_PLATFORM} + +# Object Files +OBJECTFILES= \ + ${OBJECTDIR}/main.o + + +# C Compiler Flags +CFLAGS= + +# CC Compiler Flags +CCFLAGS= +CXXFLAGS= + +# Fortran Compiler Flags +FFLAGS= + +# Assembler Flags +ASFLAGS= + +# Link Libraries and Options +LDLIBSOPTIONS= + +# Build Targets +.build-conf: ${BUILD_SUBPROJECTS} + "${MAKE}" -f nbproject/Makefile-Debug.mk dist/Debug/MinGW-Windows/memtest.exe + +dist/Debug/MinGW-Windows/memtest.exe: ${OBJECTFILES} + ${MKDIR} -p dist/Debug/MinGW-Windows + ${LINK.c} -o ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/memtest ${OBJECTFILES} ${LDLIBSOPTIONS} + +${OBJECTDIR}/main.o: main.c + ${MKDIR} -p ${OBJECTDIR} + ${RM} $@.d + $(COMPILE.c) -g -MMD -MP -MF $@.d -o ${OBJECTDIR}/main.o main.c + +# Subprojects +.build-subprojects: + +# Clean Targets +.clean-conf: ${CLEAN_SUBPROJECTS} + ${RM} -r build/Debug + ${RM} dist/Debug/MinGW-Windows/memtest.exe + +# Subprojects +.clean-subprojects: + +# Enable dependency checking +.dep.inc: .depcheck-impl + +include .dep.inc diff --git a/exp/Memtest/nbproject/Makefile-Release.mk b/exp/Memtest/nbproject/Makefile-Release.mk new file mode 100644 index 0000000..8959d7a --- /dev/null +++ b/exp/Memtest/nbproject/Makefile-Release.mk @@ -0,0 +1,82 @@ +# +# Generated Makefile - do not edit! +# +# Edit the Makefile in the project folder instead (../Makefile). Each target +# has a -pre and a -post target defined where you can add customized code. +# +# This makefile implements configuration specific macros and targets. + + +# Environment +MKDIR=mkdir +CP=cp +GREP=grep +NM=nm +CCADMIN=CCadmin +RANLIB=ranlib +CC=gcc.exe +CCC=g++.exe +CXX=g++.exe +FC= +AS=as.exe + +# Macros +CND_PLATFORM=MinGW-Windows +CND_CONF=Release +CND_DISTDIR=dist + +# Include project Makefile +include Makefile + +# Object Directory +OBJECTDIR=build/${CND_CONF}/${CND_PLATFORM} + +# Object Files +OBJECTFILES= \ + ${OBJECTDIR}/main.o + + +# C Compiler Flags +CFLAGS= + +# CC Compiler Flags +CCFLAGS= +CXXFLAGS= + +# Fortran Compiler Flags +FFLAGS= + +# Assembler Flags +ASFLAGS= + +# Link Libraries and Options +LDLIBSOPTIONS= + +# Build Targets +.build-conf: ${BUILD_SUBPROJECTS} + "${MAKE}" -f nbproject/Makefile-Release.mk dist/Release/MinGW-Windows/memtest.exe + +dist/Release/MinGW-Windows/memtest.exe: ${OBJECTFILES} + ${MKDIR} -p dist/Release/MinGW-Windows + ${LINK.c} -o ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/memtest ${OBJECTFILES} ${LDLIBSOPTIONS} + +${OBJECTDIR}/main.o: main.c + ${MKDIR} -p ${OBJECTDIR} + ${RM} $@.d + $(COMPILE.c) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/main.o main.c + +# Subprojects +.build-subprojects: + +# Clean Targets +.clean-conf: ${CLEAN_SUBPROJECTS} + ${RM} -r build/Release + ${RM} dist/Release/MinGW-Windows/memtest.exe + +# Subprojects +.clean-subprojects: + +# Enable dependency checking +.dep.inc: .depcheck-impl + +include .dep.inc diff --git a/exp/Memtest/nbproject/Makefile-impl.mk b/exp/Memtest/nbproject/Makefile-impl.mk new file mode 100644 index 0000000..cb60e6f --- /dev/null +++ b/exp/Memtest/nbproject/Makefile-impl.mk @@ -0,0 +1,133 @@ +# +# Generated Makefile - do not edit! +# +# Edit the Makefile in the project folder instead (../Makefile). Each target +# has a pre- and a post- target defined where you can add customization code. +# +# This makefile implements macros and targets common to all configurations. +# +# NOCDDL + + +# Building and Cleaning subprojects are done by default, but can be controlled with the SUB +# macro. If SUB=no, subprojects will not be built or cleaned. The following macro +# statements set BUILD_SUB-CONF and CLEAN_SUB-CONF to .build-reqprojects-conf +# and .clean-reqprojects-conf unless SUB has the value 'no' +SUB_no=NO +SUBPROJECTS=${SUB_${SUB}} +BUILD_SUBPROJECTS_=.build-subprojects +BUILD_SUBPROJECTS_NO= +BUILD_SUBPROJECTS=${BUILD_SUBPROJECTS_${SUBPROJECTS}} +CLEAN_SUBPROJECTS_=.clean-subprojects +CLEAN_SUBPROJECTS_NO= +CLEAN_SUBPROJECTS=${CLEAN_SUBPROJECTS_${SUBPROJECTS}} + + +# Project Name +PROJECTNAME=Memtest + +# Active Configuration +DEFAULTCONF=Debug +CONF=${DEFAULTCONF} + +# All Configurations +ALLCONFS=Debug Release + + +# build +.build-impl: .build-pre .validate-impl .depcheck-impl + @#echo "=> Running $@... Configuration=$(CONF)" + "${MAKE}" -f nbproject/Makefile-${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .build-conf + + +# clean +.clean-impl: .clean-pre .validate-impl .depcheck-impl + @#echo "=> Running $@... Configuration=$(CONF)" + "${MAKE}" -f nbproject/Makefile-${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .clean-conf + + +# clobber +.clobber-impl: .clobber-pre .depcheck-impl + @#echo "=> Running $@..." + for CONF in ${ALLCONFS}; \ + do \ + "${MAKE}" -f nbproject/Makefile-$${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .clean-conf; \ + done + +# all +.all-impl: .all-pre .depcheck-impl + @#echo "=> Running $@..." + for CONF in ${ALLCONFS}; \ + do \ + "${MAKE}" -f nbproject/Makefile-$${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .build-conf; \ + done + +# build tests +.build-tests-impl: .build-impl .build-tests-pre + @#echo "=> Running $@... Configuration=$(CONF)" + "${MAKE}" -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .build-tests-conf + +# run tests +.test-impl: .build-tests-impl .test-pre + @#echo "=> Running $@... Configuration=$(CONF)" + "${MAKE}" -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .test-conf + +# dependency checking support +.depcheck-impl: + @echo "# This code depends on make tool being used" >.dep.inc + @if [ -n "${MAKE_VERSION}" ]; then \ + echo "DEPFILES=\$$(wildcard \$$(addsuffix .d, \$${OBJECTFILES}))" >>.dep.inc; \ + echo "ifneq (\$${DEPFILES},)" >>.dep.inc; \ + echo "include \$${DEPFILES}" >>.dep.inc; \ + echo "endif" >>.dep.inc; \ + else \ + echo ".KEEP_STATE:" >>.dep.inc; \ + echo ".KEEP_STATE_FILE:.make.state.\$${CONF}" >>.dep.inc; \ + fi + +# configuration validation +.validate-impl: + @if [ ! -f nbproject/Makefile-${CONF}.mk ]; \ + then \ + echo ""; \ + echo "Error: can not find the makefile for configuration '${CONF}' in project ${PROJECTNAME}"; \ + echo "See 'make help' for details."; \ + echo "Current directory: " `pwd`; \ + echo ""; \ + fi + @if [ ! -f nbproject/Makefile-${CONF}.mk ]; \ + then \ + exit 1; \ + fi + + +# help +.help-impl: .help-pre + @echo "This makefile supports the following configurations:" + @echo " ${ALLCONFS}" + @echo "" + @echo "and the following targets:" + @echo " build (default target)" + @echo " clean" + @echo " clobber" + @echo " all" + @echo " help" + @echo "" + @echo "Makefile Usage:" + @echo " make [CONF=] [SUB=no] build" + @echo " make [CONF=] [SUB=no] clean" + @echo " make [SUB=no] clobber" + @echo " make [SUB=no] all" + @echo " make help" + @echo "" + @echo "Target 'build' will build a specific configuration and, unless 'SUB=no'," + @echo " also build subprojects." + @echo "Target 'clean' will clean a specific configuration and, unless 'SUB=no'," + @echo " also clean subprojects." + @echo "Target 'clobber' will remove all built files from all configurations and," + @echo " unless 'SUB=no', also from subprojects." + @echo "Target 'all' will will build all configurations and, unless 'SUB=no'," + @echo " also build subprojects." + @echo "Target 'help' prints this message." + @echo "" + diff --git a/exp/Memtest/nbproject/Makefile-variables.mk b/exp/Memtest/nbproject/Makefile-variables.mk new file mode 100644 index 0000000..c27294c --- /dev/null +++ b/exp/Memtest/nbproject/Makefile-variables.mk @@ -0,0 +1,24 @@ +# +# Generated - do not edit! +# +# NOCDDL +# +CND_BASEDIR=`pwd` +CND_BUILDDIR=build +CND_DISTDIR=dist +# Debug configuration +CND_PLATFORM_Debug=MinGW-Windows +CND_ARTIFACT_DIR_Debug=dist/Debug/MinGW-Windows +CND_ARTIFACT_NAME_Debug=memtest +CND_ARTIFACT_PATH_Debug=dist/Debug/MinGW-Windows/memtest +CND_PACKAGE_DIR_Debug=dist/Debug/MinGW-Windows/package +CND_PACKAGE_NAME_Debug=memtest.tar +CND_PACKAGE_PATH_Debug=dist/Debug/MinGW-Windows/package/memtest.tar +# Release configuration +CND_PLATFORM_Release=MinGW-Windows +CND_ARTIFACT_DIR_Release=dist/Release/MinGW-Windows +CND_ARTIFACT_NAME_Release=memtest +CND_ARTIFACT_PATH_Release=dist/Release/MinGW-Windows/memtest +CND_PACKAGE_DIR_Release=dist/Release/MinGW-Windows/package +CND_PACKAGE_NAME_Release=memtest.tar +CND_PACKAGE_PATH_Release=dist/Release/MinGW-Windows/package/memtest.tar diff --git a/exp/Memtest/nbproject/Package-Debug.bash b/exp/Memtest/nbproject/Package-Debug.bash new file mode 100644 index 0000000..83a5284 --- /dev/null +++ b/exp/Memtest/nbproject/Package-Debug.bash @@ -0,0 +1,74 @@ +#!/bin/bash -x + +# +# Generated - do not edit! +# + +# Macros +TOP=`pwd` +CND_PLATFORM=MinGW-Windows +CND_CONF=Debug +CND_DISTDIR=dist +NBTMPDIR=build/${CND_CONF}/${CND_PLATFORM}/tmp-packaging +TMPDIRNAME=tmp-packaging +OUTPUT_PATH=${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/memtest +OUTPUT_BASENAME=memtest +PACKAGE_TOP_DIR=memtest/ + +# Functions +function checkReturnCode +{ + rc=$? + if [ $rc != 0 ] + then + exit $rc + fi +} +function makeDirectory +# $1 directory path +# $2 permission (optional) +{ + mkdir -p "$1" + checkReturnCode + if [ "$2" != "" ] + then + chmod $2 "$1" + checkReturnCode + fi +} +function copyFileToTmpDir +# $1 from-file path +# $2 to-file path +# $3 permission +{ + cp "$1" "$2" + checkReturnCode + if [ "$3" != "" ] + then + chmod $3 "$2" + checkReturnCode + fi +} + +# Setup +cd "${TOP}" +mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package +rm -rf ${NBTMPDIR} +mkdir -p ${NBTMPDIR} + +# Copy files and create directories and links +cd "${TOP}" +makeDirectory "${NBTMPDIR}/memtest/bin" +copyFileToTmpDir "${OUTPUT_PATH}.exe" "${NBTMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}.exe" 0755 + + +# Generate tar file +cd "${TOP}" +rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/memtest.tar +cd ${NBTMPDIR} +tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/memtest.tar * +checkReturnCode + +# Cleanup +cd "${TOP}" +rm -rf ${NBTMPDIR} diff --git a/exp/Memtest/nbproject/Package-Release.bash b/exp/Memtest/nbproject/Package-Release.bash new file mode 100644 index 0000000..e3e78da --- /dev/null +++ b/exp/Memtest/nbproject/Package-Release.bash @@ -0,0 +1,74 @@ +#!/bin/bash -x + +# +# Generated - do not edit! +# + +# Macros +TOP=`pwd` +CND_PLATFORM=MinGW-Windows +CND_CONF=Release +CND_DISTDIR=dist +NBTMPDIR=build/${CND_CONF}/${CND_PLATFORM}/tmp-packaging +TMPDIRNAME=tmp-packaging +OUTPUT_PATH=${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/memtest +OUTPUT_BASENAME=memtest +PACKAGE_TOP_DIR=memtest/ + +# Functions +function checkReturnCode +{ + rc=$? + if [ $rc != 0 ] + then + exit $rc + fi +} +function makeDirectory +# $1 directory path +# $2 permission (optional) +{ + mkdir -p "$1" + checkReturnCode + if [ "$2" != "" ] + then + chmod $2 "$1" + checkReturnCode + fi +} +function copyFileToTmpDir +# $1 from-file path +# $2 to-file path +# $3 permission +{ + cp "$1" "$2" + checkReturnCode + if [ "$3" != "" ] + then + chmod $3 "$2" + checkReturnCode + fi +} + +# Setup +cd "${TOP}" +mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package +rm -rf ${NBTMPDIR} +mkdir -p ${NBTMPDIR} + +# Copy files and create directories and links +cd "${TOP}" +makeDirectory "${NBTMPDIR}/memtest/bin" +copyFileToTmpDir "${OUTPUT_PATH}.exe" "${NBTMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}.exe" 0755 + + +# Generate tar file +cd "${TOP}" +rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/memtest.tar +cd ${NBTMPDIR} +tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/memtest.tar * +checkReturnCode + +# Cleanup +cd "${TOP}" +rm -rf ${NBTMPDIR} diff --git a/exp/Memtest/nbproject/configurations.xml b/exp/Memtest/nbproject/configurations.xml new file mode 100644 index 0000000..9e0a9d0 --- /dev/null +++ b/exp/Memtest/nbproject/configurations.xml @@ -0,0 +1,65 @@ + + + + + + + + + main.c + + + + + Makefile + + + Makefile + + + + localhost + MinGW|MinGW + 3 + + + + + + + localhost + MinGW|MinGW + 3 + + + + 5 + + + 5 + + + 5 + + + 5 + + + + + diff --git a/exp/Memtest/nbproject/project.xml b/exp/Memtest/nbproject/project.xml new file mode 100644 index 0000000..5c9493f --- /dev/null +++ b/exp/Memtest/nbproject/project.xml @@ -0,0 +1,20 @@ + + + org.netbeans.modules.cnd.makeproject + + + Memtest + 0 + c + + + + + + Debug + Release + + UTF-8 + + + diff --git a/exp/README.md b/exp/README.md index 9ba4f74..ea01635 100644 --- a/exp/README.md +++ b/exp/README.md @@ -15,3 +15,22 @@ output and NetBeans private settings. ramdisk writer. The writer's sources are in `Modules/Rom image maker/`; this is the 2011-09-05 variant of the image, which differs from the copy stored there. + +## User-space prototypes + +Kernel pieces developed and tested as ordinary programs before being ported +into the kernel (2011). + +- `MemManager/` (Apr-Jun 2011): physical memory block manager (alloc, free, + split, concatenate) with an interactive console to test it. An earlier + Eclipse version is in `Memory manager/`. +- `luxTime/` (Jun 2011): date and time structure and conversion routines. +- `luxKeyboardHandler/` (Jun 2011): keyboard controller commands and scancode + handling. +- `Memtest/` (Aug 2011): small memory test program. +- `luxOS/` (Jun-Aug 2011): NetBeans project that wraps the kernel tree + (Makefile, build.sh) so the OS could be built from the IDE. Only the project + shell, the sources live in the repository root. +- `ctaos/` (Nov 2010 - Mar 2011): NetBeans project shell for an earlier, + tutorial-based kernel (kernel.c, interrupt, PIT, GDT/IDT/IRQ/PIC sources). + Only the project files survive, the sources are not included. diff --git a/exp/ctaos/ctaos-Makefile.mk b/exp/ctaos/ctaos-Makefile.mk new file mode 100644 index 0000000..d9911bc --- /dev/null +++ b/exp/ctaos/ctaos-Makefile.mk @@ -0,0 +1,45 @@ +# User sets these +CC = gcc +ASM = nasm +CURDIR = /media/6C9EE8DF9EE8A336/ctaos + +# Other parameters & paths used +LSCRIPT = SysCore/objects/linker.ld +OBJ = SysCore/objects + +CCPARAM = -Wall -O -fstrength-reduce -fomit-frame-pointer -nostdinc -fno-builtin -I./SysCore/include -c +ASMPARAMobj = -f aout +ASMPARAMbin = -f bin + +ctaos.img : Build/bootload.bin Build/stage2.cta Build/kernel.bin + dd bs=512 count=2880 if=/dev/zero of=ctaos.img + mkfs.msdos ctaos.img + dd bs=512 count=1 conv=notrunc if=Build/bootload.bin of=ctaos.img + sudo mkdir /media/floppy1/ + sudo mount -o loop ctaos.img /media/floppy1/ + cp Build/stage2.cta /media/floppy1 + cp Build/kernel.bin /media/floppy1 + sudo umount /media/floppy1/ + sudo rm --force /media/floppy1/ + + +Build/bootload.bin : SysBoot/stage1/bootload.asm + +SysBoot/stage1/bootload.asm: + $(ASM) $(ASMPARAMbin) SysBoot/stage1/bootload.asm -o Build/bootload.bin + +Build/stage2.cta : SysBoot/stage2/stage2.asm \ + SysBoot/stage2/a20.inc \ + SysBoot/stage2/bootinfo.inc \ + SysBoot/stage2/common.inc \ + SysBoot/stage2/fat12.inc \ + SysBoot/stage2/floppy16.inc \ + SysBoot/stage2/gdt.inc \ + SysBoot/stage2/getdata.inc \ + SysBoot/stage2/memory.inc \ + SysBoot/stage2/paging.inc \ + SysBoot/stage2/stdio.inc + $(ASM) $(ASMPARAMbin) -o ./.build/stage2.cta SysBoot/stage2/stage2.asm + +Build/kernel.bin : + dd bs=1024 count=20 if=/dev/zero of=.build/kernel.bin \ No newline at end of file diff --git a/exp/ctaos/nbproject/Makefile-Default.mk b/exp/ctaos/nbproject/Makefile-Default.mk new file mode 100644 index 0000000..3179bb9 --- /dev/null +++ b/exp/ctaos/nbproject/Makefile-Default.mk @@ -0,0 +1,66 @@ +# +# Generated Makefile - do not edit! +# +# Edit the Makefile in the project folder instead (../Makefile). Each target +# has a -pre and a -post target defined where you can add customized code. +# +# This makefile implements configuration specific macros and targets. + + +# Environment +MKDIR=mkdir +CP=cp +GREP=grep +NM=nm +CCADMIN=CCadmin +RANLIB=ranlib +CC=gcc +CCC=g++ +CXX=g++ +FC= +AS=nasm + +# Macros +CND_PLATFORM=GNU-Nasm-Linux-x86 +CND_CONF=Default +CND_DISTDIR=dist + +# Include project Makefile +include ctaos-Makefile.mk + +# Object Directory +OBJECTDIR=build/${CND_CONF}/${CND_PLATFORM} + +# Object Files +OBJECTFILES= + + +# C Compiler Flags +CFLAGS= + +# CC Compiler Flags +CCFLAGS= +CXXFLAGS= + +# Fortran Compiler Flags +FFLAGS= + +# Assembler Flags +ASFLAGS= + +# Link Libraries and Options +LDLIBSOPTIONS= + +# Build Targets +.build-conf: ${BUILD_SUBPROJECTS} + cd /media/6C9EE8DF9EE8A336/ctaos && ${MAKE} -f Makefile + +# Subprojects +.build-subprojects: + +# Clean Targets +.clean-conf: ${CLEAN_SUBPROJECTS} + cd /media/6C9EE8DF9EE8A336/ctaos && ${MAKE} -f Makefile clean + +# Subprojects +.clean-subprojects: diff --git a/exp/ctaos/nbproject/Makefile-impl.mk b/exp/ctaos/nbproject/Makefile-impl.mk new file mode 100644 index 0000000..023bb7a --- /dev/null +++ b/exp/ctaos/nbproject/Makefile-impl.mk @@ -0,0 +1,133 @@ +# +# Generated Makefile - do not edit! +# +# Edit the Makefile in the project folder instead (../Makefile). Each target +# has a pre- and a post- target defined where you can add customization code. +# +# This makefile implements macros and targets common to all configurations. +# +# NOCDDL + + +# Building and Cleaning subprojects are done by default, but can be controlled with the SUB +# macro. If SUB=no, subprojects will not be built or cleaned. The following macro +# statements set BUILD_SUB-CONF and CLEAN_SUB-CONF to .build-reqprojects-conf +# and .clean-reqprojects-conf unless SUB has the value 'no' +SUB_no=NO +SUBPROJECTS=${SUB_${SUB}} +BUILD_SUBPROJECTS_=.build-subprojects +BUILD_SUBPROJECTS_NO= +BUILD_SUBPROJECTS=${BUILD_SUBPROJECTS_${SUBPROJECTS}} +CLEAN_SUBPROJECTS_=.clean-subprojects +CLEAN_SUBPROJECTS_NO= +CLEAN_SUBPROJECTS=${CLEAN_SUBPROJECTS_${SUBPROJECTS}} + + +# Project Name +PROJECTNAME=ctaos + +# Active Configuration +DEFAULTCONF=Default +CONF=${DEFAULTCONF} + +# All Configurations +ALLCONFS=Default + + +# build +.build-impl: .build-pre .validate-impl .depcheck-impl + @#echo "=> Running $@... Configuration=$(CONF)" + "${MAKE}" -f nbproject/Makefile-${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .build-conf + + +# clean +.clean-impl: .clean-pre .validate-impl .depcheck-impl + @#echo "=> Running $@... Configuration=$(CONF)" + "${MAKE}" -f nbproject/Makefile-${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .clean-conf + + +# clobber +.clobber-impl: .clobber-pre .depcheck-impl + @#echo "=> Running $@..." + for CONF in ${ALLCONFS}; \ + do \ + "${MAKE}" -f nbproject/Makefile-$${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .clean-conf; \ + done + +# all +.all-impl: .all-pre .depcheck-impl + @#echo "=> Running $@..." + for CONF in ${ALLCONFS}; \ + do \ + "${MAKE}" -f nbproject/Makefile-$${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .build-conf; \ + done + +# build tests +.build-tests-impl: .build-impl .build-tests-pre + @#echo "=> Running $@... Configuration=$(CONF)" + "${MAKE}" -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .build-tests-conf + +# run tests +.test-impl: .build-tests-impl .test-pre + @#echo "=> Running $@... Configuration=$(CONF)" + "${MAKE}" -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .test-conf + +# dependency checking support +.depcheck-impl: + @echo "# This code depends on make tool being used" >.dep.inc + @if [ -n "${MAKE_VERSION}" ]; then \ + echo "DEPFILES=\$$(wildcard \$$(addsuffix .d, \$${OBJECTFILES}))" >>.dep.inc; \ + echo "ifneq (\$${DEPFILES},)" >>.dep.inc; \ + echo "include \$${DEPFILES}" >>.dep.inc; \ + echo "endif" >>.dep.inc; \ + else \ + echo ".KEEP_STATE:" >>.dep.inc; \ + echo ".KEEP_STATE_FILE:.make.state.\$${CONF}" >>.dep.inc; \ + fi + +# configuration validation +.validate-impl: + @if [ ! -f nbproject/Makefile-${CONF}.mk ]; \ + then \ + echo ""; \ + echo "Error: can not find the makefile for configuration '${CONF}' in project ${PROJECTNAME}"; \ + echo "See 'make help' for details."; \ + echo "Current directory: " `pwd`; \ + echo ""; \ + fi + @if [ ! -f nbproject/Makefile-${CONF}.mk ]; \ + then \ + exit 1; \ + fi + + +# help +.help-impl: .help-pre + @echo "This makefile supports the following configurations:" + @echo " ${ALLCONFS}" + @echo "" + @echo "and the following targets:" + @echo " build (default target)" + @echo " clean" + @echo " clobber" + @echo " all" + @echo " help" + @echo "" + @echo "Makefile Usage:" + @echo " make [CONF=] [SUB=no] build" + @echo " make [CONF=] [SUB=no] clean" + @echo " make [SUB=no] clobber" + @echo " make [SUB=no] all" + @echo " make help" + @echo "" + @echo "Target 'build' will build a specific configuration and, unless 'SUB=no'," + @echo " also build subprojects." + @echo "Target 'clean' will clean a specific configuration and, unless 'SUB=no'," + @echo " also clean subprojects." + @echo "Target 'clobber' will remove all built files from all configurations and," + @echo " unless 'SUB=no', also from subprojects." + @echo "Target 'all' will will build all configurations and, unless 'SUB=no'," + @echo " also build subprojects." + @echo "Target 'help' prints this message." + @echo "" + diff --git a/exp/ctaos/nbproject/Makefile-variables.mk b/exp/ctaos/nbproject/Makefile-variables.mk new file mode 100644 index 0000000..15c6965 --- /dev/null +++ b/exp/ctaos/nbproject/Makefile-variables.mk @@ -0,0 +1,16 @@ +# +# Generated - do not edit! +# +# NOCDDL +# +CND_BASEDIR=`pwd` +CND_BUILDDIR=build +CND_DISTDIR=dist +# Default configuration +CND_PLATFORM_Default=GNU-Nasm-Linux-x86 +CND_ARTIFACT_DIR_Default=/media/6C9EE8DF9EE8A336/ctaos +CND_ARTIFACT_NAME_Default=ctaos.img +CND_ARTIFACT_PATH_Default=/media/6C9EE8DF9EE8A336/ctaos/ctaos.img +CND_PACKAGE_DIR_Default=dist/Default/GNU-Nasm-Linux-x86/package +CND_PACKAGE_NAME_Default=ctaos.tar +CND_PACKAGE_PATH_Default=dist/Default/GNU-Nasm-Linux-x86/package/ctaos.tar diff --git a/exp/ctaos/nbproject/Package-Default.bash b/exp/ctaos/nbproject/Package-Default.bash new file mode 100644 index 0000000..199b6c6 --- /dev/null +++ b/exp/ctaos/nbproject/Package-Default.bash @@ -0,0 +1,74 @@ +#!/bin/bash -x + +# +# Generated - do not edit! +# + +# Macros +TOP=`pwd` +CND_PLATFORM=GNU-Nasm-Linux-x86 +CND_CONF=Default +CND_DISTDIR=dist +NBTMPDIR=build/${CND_CONF}/${CND_PLATFORM}/tmp-packaging +TMPDIRNAME=tmp-packaging +OUTPUT_PATH=/media/6C9EE8DF9EE8A336/ctaos/ctaos.img +OUTPUT_BASENAME=ctaos.img +PACKAGE_TOP_DIR=ctaos/ + +# Functions +function checkReturnCode +{ + rc=$? + if [ $rc != 0 ] + then + exit $rc + fi +} +function makeDirectory +# $1 directory path +# $2 permission (optional) +{ + mkdir -p "$1" + checkReturnCode + if [ "$2" != "" ] + then + chmod $2 "$1" + checkReturnCode + fi +} +function copyFileToTmpDir +# $1 from-file path +# $2 to-file path +# $3 permission +{ + cp "$1" "$2" + checkReturnCode + if [ "$3" != "" ] + then + chmod $3 "$2" + checkReturnCode + fi +} + +# Setup +cd "${TOP}" +mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package +rm -rf ${NBTMPDIR} +mkdir -p ${NBTMPDIR} + +# Copy files and create directories and links +cd "${TOP}" +makeDirectory "${NBTMPDIR}/ctaos/bin" +copyFileToTmpDir "${OUTPUT_PATH}" "${NBTMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755 + + +# Generate tar file +cd "${TOP}" +rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/ctaos.tar +cd ${NBTMPDIR} +tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/ctaos.tar * +checkReturnCode + +# Cleanup +cd "${TOP}" +rm -rf ${NBTMPDIR} diff --git a/exp/ctaos/nbproject/configurations.xml b/exp/ctaos/nbproject/configurations.xml new file mode 100644 index 0000000..d02ef31 --- /dev/null +++ b/exp/ctaos/nbproject/configurations.xml @@ -0,0 +1,859 @@ + + + + + + + + + + kernel.c + + + + drivers.h + floppy.h + + + + console.h + kernel.cpp + keyboard.h + system.h + + + + console.h + kernel.cpp + startup.h + + + + + + + + + console.h + kernel.cpp + startup.h + + kernel.cpp + + + + + + + + KEYCODES.H + + INT.C + INTERRUP.C + INTERRUP.H + INTPRINT.C + PORTS.C + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + clock.h + pit.c + + + + gdt.c + gdt.h + + + idt.c + idt.h + + + irq.c + irq.h + pic.c + pic.h + + + isrs.c + isrs.h + + cpu.c + cpu.h + + + fat.c + fat.h + vfs.c + vfs.h + + + dma.c + dma.h + floppy.c + floppy.h + storage.h + + + keyboard.c + keyboard.deprecated.h + + BSOD.c + drivers.c + drivers.h + + + + floppy.h + keyboard.h + + + declarat.h + + _null.h + bootinfo.h + conio.h + crtdefs.h + ctype.h + hal.h + regs.h + size_t.h + stdarg.h + stdint.h + stdlib.h + string.h + system.h + time.h + va_list.h + + + conio.c + ctype.c + stdlib.c + string.c + system.c + time.c + + + + pde.c + pde.h + pte.c + pte.h + + mmngr_ph.c + mmngr_ph.h + mmngr_vi.c + mmngr_vi.h + + + + + + + + + + + apps.h + shell.c + + + + color.c + color.h + + vga.h + vga03h.c + vga03h.h + + main.c + + + + /media/6C9EE8DF9EE8A336/ctaos/Makefile + /media/6C9EE8DF9EE8A336/ctaos/buildOS.bat + ctaos-Makefile.mk + + + + /media/6C9EE8DF9EE8A336/ctaos + + ctaos-Makefile.mk + + + + localhost + GNU-Nasm|GNU + 2 + + + + /media/6C9EE8DF9EE8A336/ctaos + ${MAKE} -f Makefile + ${MAKE} -f Makefile clean + /media/6C9EE8DF9EE8A336/ctaos/ctaos.img + + + + + + /media/6C9EE8DF9EE8A336/ctaos/SysCore/include + /media/6C9EE8DF9EE8A336/ctaos/#ARCHIVE/Desktop/ctaos++ + + + + + + + /media/6C9EE8DF9EE8A336/ctaos/SysCore/include + /media/6C9EE8DF9EE8A336/ctaos/#ARCHIVE/Desktop/ctaos++ + + + + + + + /media/6C9EE8DF9EE8A336/ctaos/SysCore/include + + + + + + + /media/6C9EE8DF9EE8A336/ctaos/SysCore/include + /media/6C9EE8DF9EE8A336/ctaos/#ARCHIVE/Desktop/ctaos++ + + + + + + + /media/6C9EE8DF9EE8A336/ctaos/SysCore/include + + + + + + + /media/6C9EE8DF9EE8A336/ctaos/SysCore/include + + + + + + + /media/6C9EE8DF9EE8A336/ctaos/SysCore/include + + + + + + + /media/6C9EE8DF9EE8A336/ctaos/#ARCHIVE/Desktop/ctaos++ + + + + + + + /media/6C9EE8DF9EE8A336/ctaos/#ARCHIVE/Desktop/ctaos++ + + + + + + + /media/6C9EE8DF9EE8A336/ctaos/SysCore/include + /media/6C9EE8DF9EE8A336/ctaos/#ARCHIVE/Desktop/ctaos++ + + + + + + + /media/6C9EE8DF9EE8A336/ctaos/SysCore/include + /media/6C9EE8DF9EE8A336/ctaos/#ARCHIVE/Desktop/ctaos++ + + + + + + + /media/6C9EE8DF9EE8A336/ctaos/SysCore/include + /media/6C9EE8DF9EE8A336/ctaos/#ARCHIVE/Desktop/ctaos++ + + + + + + + /media/6C9EE8DF9EE8A336/ctaos/#ARCHIVE/Desktop/ctaos++ + + + + + + + /media/6C9EE8DF9EE8A336/ctaos/#ARCHIVE/Desktop/ctaos++ + + + + + + + /media/6C9EE8DF9EE8A336/ctaos/SysCore/include + /media/6C9EE8DF9EE8A336/ctaos/#ARCHIVE/Desktop/ctaos++ + + + + + + + /media/6C9EE8DF9EE8A336/ctaos/#ARCHIVE/Desktop/ctaos++ + + + + + + + /media/6C9EE8DF9EE8A336/ctaos/SysCore/include + /media/6C9EE8DF9EE8A336/ctaos/#ARCHIVE/Desktop/ctaos++ + + + + + + + /media/6C9EE8DF9EE8A336/ctaos/SysCore/include + /media/6C9EE8DF9EE8A336/ctaos/#ARCHIVE/Desktop/ctaos++ + + + + + + diff --git a/exp/ctaos/nbproject/project.xml b/exp/ctaos/nbproject/project.xml new file mode 100644 index 0000000..f396b82 --- /dev/null +++ b/exp/ctaos/nbproject/project.xml @@ -0,0 +1,21 @@ + + + org.netbeans.modules.cnd.makeproject + + + ctaos + 0 + c + C,cpp + H,h + UTF-8 + + + /media/6C9EE8DF9EE8A336/ctaos + + + Default + + + + diff --git a/exp/luxKeyboardHandler/DEP~1.INC b/exp/luxKeyboardHandler/DEP~1.INC new file mode 100644 index 0000000..4560e55 --- /dev/null +++ b/exp/luxKeyboardHandler/DEP~1.INC @@ -0,0 +1,5 @@ +# This code depends on make tool being used +DEPFILES=$(wildcard $(addsuffix .d, ${OBJECTFILES})) +ifneq (${DEPFILES},) +include ${DEPFILES} +endif diff --git a/exp/luxKeyboardHandler/Makefile b/exp/luxKeyboardHandler/Makefile new file mode 100644 index 0000000..ec9de69 --- /dev/null +++ b/exp/luxKeyboardHandler/Makefile @@ -0,0 +1,128 @@ +# +# There exist several targets which are by default empty and which can be +# used for execution of your targets. These targets are usually executed +# before and after some main targets. They are: +# +# .build-pre: called before 'build' target +# .build-post: called after 'build' target +# .clean-pre: called before 'clean' target +# .clean-post: called after 'clean' target +# .clobber-pre: called before 'clobber' target +# .clobber-post: called after 'clobber' target +# .all-pre: called before 'all' target +# .all-post: called after 'all' target +# .help-pre: called before 'help' target +# .help-post: called after 'help' target +# +# Targets beginning with '.' are not intended to be called on their own. +# +# Main targets can be executed directly, and they are: +# +# build build a specific configuration +# clean remove built files from a configuration +# clobber remove all built files +# all build all configurations +# help print help mesage +# +# Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and +# .help-impl are implemented in nbproject/makefile-impl.mk. +# +# Available make variables: +# +# CND_BASEDIR base directory for relative paths +# CND_DISTDIR default top distribution directory (build artifacts) +# CND_BUILDDIR default top build directory (object files, ...) +# CONF name of current configuration +# CND_PLATFORM_${CONF} platform name (current configuration) +# CND_ARTIFACT_DIR_${CONF} directory of build artifact (current configuration) +# CND_ARTIFACT_NAME_${CONF} name of build artifact (current configuration) +# CND_ARTIFACT_PATH_${CONF} path to build artifact (current configuration) +# CND_PACKAGE_DIR_${CONF} directory of package (current configuration) +# CND_PACKAGE_NAME_${CONF} name of package (current configuration) +# CND_PACKAGE_PATH_${CONF} path to package (current configuration) +# +# NOCDDL + + +# Environment +MKDIR=mkdir +CP=cp +CCADMIN=CCadmin + + +# build +build: .build-post + +.build-pre: +# Add your pre 'build' code here... + +.build-post: .build-impl +# Add your post 'build' code here... + + +# clean +clean: .clean-post + +.clean-pre: +# Add your pre 'clean' code here... + +.clean-post: .clean-impl +# Add your post 'clean' code here... + + +# clobber +clobber: .clobber-post + +.clobber-pre: +# Add your pre 'clobber' code here... + +.clobber-post: .clobber-impl +# Add your post 'clobber' code here... + + +# all +all: .all-post + +.all-pre: +# Add your pre 'all' code here... + +.all-post: .all-impl +# Add your post 'all' code here... + + +# build tests +build-tests: .build-tests-post + +.build-tests-pre: +# Add your pre 'build-tests' code here... + +.build-tests-post: .build-tests-impl +# Add your post 'build-tests' code here... + + +# run tests +test: .test-post + +.test-pre: +# Add your pre 'test' code here... + +.test-post: .test-impl +# Add your post 'test' code here... + + +# help +help: .help-post + +.help-pre: +# Add your pre 'help' code here... + +.help-post: .help-impl +# Add your post 'help' code here... + + + +# include project implementation makefile +include nbproject/Makefile-impl.mk + +# include project make variables +include nbproject/Makefile-variables.mk diff --git a/exp/luxKeyboardHandler/main.c b/exp/luxKeyboardHandler/main.c new file mode 100644 index 0000000..485c6e5 --- /dev/null +++ b/exp/luxKeyboardHandler/main.c @@ -0,0 +1,238 @@ +/* + * File: main.c + * Author: tiberiu + * + * Created on June 29, 2011, 11:34 AM + */ + +#include +#include + +#include +#include "types.h" + + +#define KeybCmdWriteLED 0xed +#define KeybCmdEcho 0xee +#define KeybCmdSetScancodeSet 0xf0 +#define KeybCmdGetID 0xf2 +#define KeybCmdSetRepeatDelay 0xf3 +#define KeybCmdEnable 0xf4 +#define KeybCmdSetDefaultDisable 0xf5 +#define KeybCmdSetDefault 0xf6 +#define KeybCmdResend 0xfe +#define KeybCmdReset 0xff + +volatile uint8 KeyState[16]; +volatile uint8 KeyboardLastStatus; +volatile uint8 KeyboardLastScancode; + +uint8 KeyboardScancodeSet = 2; + +// Byte map: +// 0 If set, next code is break +// 1 'Gray' key +// 2 'Weird' key (Pause/Break) +uint8 KeyboardModifiers; + +void KeyboardSetLEDs (uint8 scroll, uint8 num, uint8 caps); +uint8 GetScancode(); + + +const char KeyboardMap[] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '\t', '`', 0, + 0, 0, 0, 0, 0, 'q', '1', 0, 0, 0, 'z', 's', 'a', 'w', '2', 0, + 0, 'c', 'x', 'd', 'e', '4', '3', 0, 0, ' ', 'v', 'f', 't', 'r', '5', 0, + 0, 'n', 'b', 'h', 'g', 'y', '6', 0, 0, 0, 'm', 'j', 'u', '7', '8', 0, + 0, ',', 'k', 'i', 'o', '0', '9', 0, 0, '.', '/', 'l', ';', 'p', '-', 0, + 0, 0, '\'', 0, '[', '=', 0, 0, 0, 0, '\n', ']', 0, '\\', 0, 0, + 0, 0, 0, 0, 0, 0, '\b', 0, 0, '1', '/', '4', '7', '\n', 0, 0, + '0', '.', '2', '5', '6', '8', 0, 0, 0, '+', '3', '-', '*', '9', 0, 0 + }; + +const char KeyboardMapShift[] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '\t', '~', 0, + 0, 0, 0, 0, 0, 'Q', '!', 0, 0, 0, 'Z', 'S', 'A', 'W', '@', 0, + 0, 'C', 'X', 'D', 'E', '$', '#', 0, 0, ' ', 'V', 'F', 'T', 'R', '%', 0, + 0, 'N', 'B', 'H', 'G', 'Y', '^', 0, 0, 0, 'M', 'J', 'U', '&', '*', 0, + 0, '<', 'K', 'I', 'O', ')', '(', 0, 0, '>', '?', 'L', ':', 'P', '_', 0, + 0, 0, '\"', 0, '{', '+', 0, 0, 0, 0, '\n', '}', 0, '|', 0, 0, + 0, 0, 0, 0, 0, 0, '\b', 0, 0, '1', '/', '4', '7', '\n', 0, 0, + '0', '.', '2', '5', '6', '8', 0, 0, 0, '+', '3', '-', '*', '9', 0, 0 + }; + + +void KeyboardSetKeyStatus (uint8 scancode, uint8 status) +{ + int32 index = scancode>>3, pos = scancode & 0x7; + + if (status) KeyState[index] |= 1<>3, pos = scancode & 0x7; + + return KeyState[index] & (1< Running $@... Configuration=$(CONF)" + "${MAKE}" -f nbproject/Makefile-${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .build-conf + + +# clean +.clean-impl: .clean-pre .validate-impl .depcheck-impl + @#echo "=> Running $@... Configuration=$(CONF)" + "${MAKE}" -f nbproject/Makefile-${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .clean-conf + + +# clobber +.clobber-impl: .clobber-pre .depcheck-impl + @#echo "=> Running $@..." + for CONF in ${ALLCONFS}; \ + do \ + "${MAKE}" -f nbproject/Makefile-$${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .clean-conf; \ + done + +# all +.all-impl: .all-pre .depcheck-impl + @#echo "=> Running $@..." + for CONF in ${ALLCONFS}; \ + do \ + "${MAKE}" -f nbproject/Makefile-$${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .build-conf; \ + done + +# build tests +.build-tests-impl: .build-impl .build-tests-pre + @#echo "=> Running $@... Configuration=$(CONF)" + "${MAKE}" -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .build-tests-conf + +# run tests +.test-impl: .build-tests-impl .test-pre + @#echo "=> Running $@... Configuration=$(CONF)" + "${MAKE}" -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .test-conf + +# dependency checking support +.depcheck-impl: + @echo "# This code depends on make tool being used" >.dep.inc + @if [ -n "${MAKE_VERSION}" ]; then \ + echo "DEPFILES=\$$(wildcard \$$(addsuffix .d, \$${OBJECTFILES}))" >>.dep.inc; \ + echo "ifneq (\$${DEPFILES},)" >>.dep.inc; \ + echo "include \$${DEPFILES}" >>.dep.inc; \ + echo "endif" >>.dep.inc; \ + else \ + echo ".KEEP_STATE:" >>.dep.inc; \ + echo ".KEEP_STATE_FILE:.make.state.\$${CONF}" >>.dep.inc; \ + fi + +# configuration validation +.validate-impl: + @if [ ! -f nbproject/Makefile-${CONF}.mk ]; \ + then \ + echo ""; \ + echo "Error: can not find the makefile for configuration '${CONF}' in project ${PROJECTNAME}"; \ + echo "See 'make help' for details."; \ + echo "Current directory: " `pwd`; \ + echo ""; \ + fi + @if [ ! -f nbproject/Makefile-${CONF}.mk ]; \ + then \ + exit 1; \ + fi + + +# help +.help-impl: .help-pre + @echo "This makefile supports the following configurations:" + @echo " ${ALLCONFS}" + @echo "" + @echo "and the following targets:" + @echo " build (default target)" + @echo " clean" + @echo " clobber" + @echo " all" + @echo " help" + @echo "" + @echo "Makefile Usage:" + @echo " make [CONF=] [SUB=no] build" + @echo " make [CONF=] [SUB=no] clean" + @echo " make [SUB=no] clobber" + @echo " make [SUB=no] all" + @echo " make help" + @echo "" + @echo "Target 'build' will build a specific configuration and, unless 'SUB=no'," + @echo " also build subprojects." + @echo "Target 'clean' will clean a specific configuration and, unless 'SUB=no'," + @echo " also clean subprojects." + @echo "Target 'clobber' will remove all built files from all configurations and," + @echo " unless 'SUB=no', also from subprojects." + @echo "Target 'all' will will build all configurations and, unless 'SUB=no'," + @echo " also build subprojects." + @echo "Target 'help' prints this message." + @echo "" + diff --git a/exp/luxKeyboardHandler/nbproject/Makefile-variables.mk b/exp/luxKeyboardHandler/nbproject/Makefile-variables.mk new file mode 100644 index 0000000..e093b02 --- /dev/null +++ b/exp/luxKeyboardHandler/nbproject/Makefile-variables.mk @@ -0,0 +1,24 @@ +# +# Generated - do not edit! +# +# NOCDDL +# +CND_BASEDIR=`pwd` +CND_BUILDDIR=build +CND_DISTDIR=dist +# Debug configuration +CND_PLATFORM_Debug=GNU-Linux-x86 +CND_ARTIFACT_DIR_Debug=dist/Debug/GNU-Linux-x86 +CND_ARTIFACT_NAME_Debug=luxkeyboardhandler +CND_ARTIFACT_PATH_Debug=dist/Debug/GNU-Linux-x86/luxkeyboardhandler +CND_PACKAGE_DIR_Debug=dist/Debug/GNU-Linux-x86/package +CND_PACKAGE_NAME_Debug=luxkeyboardhandler.tar +CND_PACKAGE_PATH_Debug=dist/Debug/GNU-Linux-x86/package/luxkeyboardhandler.tar +# Release configuration +CND_PLATFORM_Release=GNU-Linux-x86 +CND_ARTIFACT_DIR_Release=dist/Release/GNU-Linux-x86 +CND_ARTIFACT_NAME_Release=luxkeyboardhandler +CND_ARTIFACT_PATH_Release=dist/Release/GNU-Linux-x86/luxkeyboardhandler +CND_PACKAGE_DIR_Release=dist/Release/GNU-Linux-x86/package +CND_PACKAGE_NAME_Release=luxkeyboardhandler.tar +CND_PACKAGE_PATH_Release=dist/Release/GNU-Linux-x86/package/luxkeyboardhandler.tar diff --git a/exp/luxKeyboardHandler/nbproject/Package-Debug.bash b/exp/luxKeyboardHandler/nbproject/Package-Debug.bash new file mode 100644 index 0000000..e9c1537 --- /dev/null +++ b/exp/luxKeyboardHandler/nbproject/Package-Debug.bash @@ -0,0 +1,74 @@ +#!/bin/bash -x + +# +# Generated - do not edit! +# + +# Macros +TOP=`pwd` +CND_PLATFORM=GNU-Linux-x86 +CND_CONF=Debug +CND_DISTDIR=dist +NBTMPDIR=build/${CND_CONF}/${CND_PLATFORM}/tmp-packaging +TMPDIRNAME=tmp-packaging +OUTPUT_PATH=${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/luxkeyboardhandler +OUTPUT_BASENAME=luxkeyboardhandler +PACKAGE_TOP_DIR=luxkeyboardhandler/ + +# Functions +function checkReturnCode +{ + rc=$? + if [ $rc != 0 ] + then + exit $rc + fi +} +function makeDirectory +# $1 directory path +# $2 permission (optional) +{ + mkdir -p "$1" + checkReturnCode + if [ "$2" != "" ] + then + chmod $2 "$1" + checkReturnCode + fi +} +function copyFileToTmpDir +# $1 from-file path +# $2 to-file path +# $3 permission +{ + cp "$1" "$2" + checkReturnCode + if [ "$3" != "" ] + then + chmod $3 "$2" + checkReturnCode + fi +} + +# Setup +cd "${TOP}" +mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package +rm -rf ${NBTMPDIR} +mkdir -p ${NBTMPDIR} + +# Copy files and create directories and links +cd "${TOP}" +makeDirectory "${NBTMPDIR}/luxkeyboardhandler/bin" +copyFileToTmpDir "${OUTPUT_PATH}" "${NBTMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755 + + +# Generate tar file +cd "${TOP}" +rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/luxkeyboardhandler.tar +cd ${NBTMPDIR} +tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/luxkeyboardhandler.tar * +checkReturnCode + +# Cleanup +cd "${TOP}" +rm -rf ${NBTMPDIR} diff --git a/exp/luxKeyboardHandler/nbproject/Package-Release.bash b/exp/luxKeyboardHandler/nbproject/Package-Release.bash new file mode 100644 index 0000000..cf4634b --- /dev/null +++ b/exp/luxKeyboardHandler/nbproject/Package-Release.bash @@ -0,0 +1,74 @@ +#!/bin/bash -x + +# +# Generated - do not edit! +# + +# Macros +TOP=`pwd` +CND_PLATFORM=GNU-Linux-x86 +CND_CONF=Release +CND_DISTDIR=dist +NBTMPDIR=build/${CND_CONF}/${CND_PLATFORM}/tmp-packaging +TMPDIRNAME=tmp-packaging +OUTPUT_PATH=${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/luxkeyboardhandler +OUTPUT_BASENAME=luxkeyboardhandler +PACKAGE_TOP_DIR=luxkeyboardhandler/ + +# Functions +function checkReturnCode +{ + rc=$? + if [ $rc != 0 ] + then + exit $rc + fi +} +function makeDirectory +# $1 directory path +# $2 permission (optional) +{ + mkdir -p "$1" + checkReturnCode + if [ "$2" != "" ] + then + chmod $2 "$1" + checkReturnCode + fi +} +function copyFileToTmpDir +# $1 from-file path +# $2 to-file path +# $3 permission +{ + cp "$1" "$2" + checkReturnCode + if [ "$3" != "" ] + then + chmod $3 "$2" + checkReturnCode + fi +} + +# Setup +cd "${TOP}" +mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package +rm -rf ${NBTMPDIR} +mkdir -p ${NBTMPDIR} + +# Copy files and create directories and links +cd "${TOP}" +makeDirectory "${NBTMPDIR}/luxkeyboardhandler/bin" +copyFileToTmpDir "${OUTPUT_PATH}" "${NBTMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755 + + +# Generate tar file +cd "${TOP}" +rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/luxkeyboardhandler.tar +cd ${NBTMPDIR} +tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/luxkeyboardhandler.tar * +checkReturnCode + +# Cleanup +cd "${TOP}" +rm -rf ${NBTMPDIR} diff --git a/exp/luxKeyboardHandler/nbproject/configurations.xml b/exp/luxKeyboardHandler/nbproject/configurations.xml new file mode 100644 index 0000000..d087701 --- /dev/null +++ b/exp/luxKeyboardHandler/nbproject/configurations.xml @@ -0,0 +1,66 @@ + + + + + types.h + + + + + main.c + + + + + Makefile + + + Makefile + + + + localhost + GNU|GNU + 2 + + + + + + + localhost + GNU|GNU + 2 + + + + 5 + + + 5 + + + 5 + + + 5 + + + + + diff --git a/exp/luxKeyboardHandler/nbproject/project.xml b/exp/luxKeyboardHandler/nbproject/project.xml new file mode 100644 index 0000000..7dfa06f --- /dev/null +++ b/exp/luxKeyboardHandler/nbproject/project.xml @@ -0,0 +1,20 @@ + + + org.netbeans.modules.cnd.makeproject + + + luxKeyboardHandler + 0 + c + + h + UTF-8 + + + + Debug + Release + + + + diff --git a/exp/luxKeyboardHandler/types.h b/exp/luxKeyboardHandler/types.h new file mode 100644 index 0000000..9615f71 --- /dev/null +++ b/exp/luxKeyboardHandler/types.h @@ -0,0 +1,252 @@ +#ifndef __TYPES__H +#define __TYPES__H + + +/**************************************** + * Int definitions * + ****************************************/ +typedef signed char int8; +typedef unsigned char uint8; +typedef short int16; +typedef unsigned short uint16; +typedef int int32; +typedef unsigned uint32; +typedef long long int64; +typedef unsigned long long uint64; + + +/**************************************** + * Limits definitions * + ****************************************/ +#define INT8_MIN (-128) +#define INT16_MIN (-32768) +#define INT32_MIN (-2147483647 - 1) +#define INT64_MIN (-9223372036854775807LL - 1) + +#define INT8_MAX 127 +#define INT16_MAX 32767 +#define INT32_MAX 2147483647 +#define INT64_MAX 9223372036854775807LL + +#define UINT8_MAX 0xff /* 255U */ +#define UINT16_MAX 0xffff /* 65535U */ +#define UINT32_MAX 0xffffffff /* 4294967295U */ +#define UINT64_MAX 0xffffffffffffffffULL /* 18446744073709551615ULL */ + + +/**************************************** + * Registers * + ****************************************/ +// 32 bit registers +typedef struct { + uint32 eax, ebx, ecx, edx, esi, edi, ebp, esp, eflags; + uint8 cflag; +} _R32BIT; + +// 16 bit registers +typedef struct { + uint16 ax, bx, cx, dx, si, di, bp, sp, es, cs, ss, ds, flags; + uint8 cflag; +} _R16BIT ; + +// 16 bit registers expressed in 32 bit registers +typedef struct { + uint16 ax, axh, bx, bxh, cx, cxh, dx, dxh; + uint16 si, di, bp, sp, es, cs, ss, ds, flags; + uint8 cflags; +} _R16BIT32 ; + +// 8 bit registers +typedef struct { + uint8 al, ah, bl, bh, cl, ch, dl, dh; +} _R8BIT; + +// 8 bit registers expressed in 32 bit registers +typedef struct { + uint8 al, ah; uint16 axh; + uint8 bl, bh; uint16 bxh; + uint8 cl, ch; uint16 cxh; + uint8 dl, dh; uint16 dxh; +} _R8BIT32; + +// 8 and 16 bit registers union +typedef union { + _R16BIT x; + _R8BIT h; +}_INTR16; + +// 32 bit, 16 bit and 8 bit registers union +typedef union { + _R32BIT x; + _R16BIT32 l; + _R8BIT32 h; +} _INTR32; + +/* This defines what the stack looks like after an ISR was running */ +typedef struct +{ + uint32 gs, fs, es, ds; /* pushed the segs last */ + uint32 edi, esi, ebp, esp, ebx, edx, ecx, eax; /* pushed by 'pusha' */ + uint32 int_no, err_code; /* our 'push byte #' and ecodes do this */ + uint32 eip, cs, eflags, useresp, ss; /* pushed by the processor automatically */ +} _RegsStack32; + + +/**************************************** + * Keyboard data types * + ****************************************/ +enum KeyboardKeys { + + KeyboardKeyF9 = 0x01, + KeyboardKeyF7 = 0x02, + KeyboardKeyF5 = 0x03, + KeyboardKeyF3 = 0x04, + KeyboardKeyF1 = 0x05, + KeyboardKeyF2 = 0x06, + KeyboardKeyF12 = 0x07, + KeyboardKeyMediaNext = 0x08, + KeyboardKeyF10 = 0x09, + KeyboardKeyF8 = 0x0A, + KeyboardKeyF6 = 0x0B, + KeyboardKeyF4 = 0x0C, + KeyboardKeyTab = 0x0D, + KeyboardKeyTilda = 0x0E, + KeyboardKeyMediaPrevious = 0x0F, + KeyboardKeyMediaStop = 0x10, + KeyboardKeyLeftAlt = 0x11, + KeyboardKeyLeftShift = 0x12, + KeyboardKeyMediaPause = 0x13, + KeyboardKeyLeftCtrl = 0x14, + KeyboardKeyQ = 0x15, + KeyboardKey1 = 0x16, + KeyboardKeyMediaVolUp = 0x17, + KeyboardKeyMediaVolDown = 0x18, + KeyboardKeyMediaSelect = 0x19, + KeyboardKeyZ = 0x1A, + KeyboardKeyS = 0x1B, + KeyboardKeyA = 0x1C, + KeyboardKeyW = 0x1D, + KeyboardKey2 = 0x1E, + KeyboardKeyLeftWin = 0x1F, + KeyboardKeyMediaEmail = 0x20, + KeyboardKeyC = 0x21, + KeyboardKeyX = 0x22, + KeyboardKeyD = 0x23, + KeyboardKeyE = 0x24, + KeyboardKey4 = 0x25, + KeyboardKey3 = 0x26, + KeyboardKeyRightWin = 0x27, + KeyboardKeyMediaCalculator = 0x28, + KeyboardKeySpace = 0x29, + KeyboardKeyV = 0x2A, + KeyboardKeyF = 0x2B, + KeyboardKeyT = 0x2C, + KeyboardKeyR = 0x2D, + KeyboardKey5 = 0x2E, + KeyboardKeyMenu = 0x2F, + KeyboardKeyMediaComputer = 0x30, + KeyboardKeyN = 0x31, + KeyboardKeyB = 0x32, + KeyboardKeyH = 0x33, + KeyboardKeyG = 0x34, + KeyboardKeyY = 0x35, + KeyboardKey6 = 0x36, + KeyboardKeyPower = 0x37, + KeyboardKeyMediaWebSearch = 0x38, + KeyboardKeyMediaWebHome = 0x39, + KeyboardKeyM = 0x3A, + KeyboardKeyJ = 0x3B, + KeyboardKeyU = 0x3C, + KeyboardKey7 = 0x3D, + KeyboardKey8 = 0x3E, + KeyboardKeySleep = 0x3F, + KeyboardKeyWake = 0x40, + KeyboardKeyComma = 0x41, + KeyboardKeyK = 0x42, + KeyboardKeyI = 0x43, + KeyboardKeyO = 0x44, + KeyboardKey0 = 0x45, + KeyboardKey9 = 0x46, + KeyboardKeyMediaWebBack = 0x47, + KeyboardKeyMediaWebForward = 0x48, + KeyboardKeyPeriod = 0x49, + KeyboardKeySlash = 0x4A, + KeyboardKeyL = 0x4B, + KeyboardKeySemicolon = 0x4C, + KeyboardKeyP = 0x4D, + KeyboardKeyDash = 0x4E, + KeyboardKeyMediaWebStop = 0x4F, + KeyboardKeyMediaWebRefresh = 0x50, + KeyboardKeyMediaWebFavorites = 0x51, + KeyboardKeyApostrophe = 0x52, + KeyboardKeyRightAlt = 0x53, + KeyboardKeyLeftBracket = 0x54, + KeyboardKeyEqual = 0x55, + KeyboardKeyPrintScreen = 0x56, + KeyboardKeyPause = 0x57, + KeyboardKeyCapsLock = 0x58, + KeyboardKeyRightShift = 0x59, + KeyboardKeyReturn = 0x5A, + KeyboardKeyRightBracket = 0x5B, + KeyboardKeyRightCtrl = 0x5C, + KeyboardKeyBackSlash = 0x5D, + KeyboardKeyInsert = 0x5E, + KeyboardKeyDelete = 0x5F, + KeyboardKeyHome = 0x60, + KeyboardKeyEnd = 0x61, + KeyboardKeyPageUp = 0x62, + KeyboardKeyPageDown = 0x63, + KeyboardKeyLeft = 0x64, + KeyboardKeyDown = 0x65, + KeyboardKeyBackspace = 0x66, + KeyboardKeyRight = 0x67, + KeyboardKeyUp = 0x68, + KeyboardKeyNumpad1 = 0x69, + KeyboardKeyNumpadSlash = 0x6A, + KeyboardKeyNumpad4 = 0x6B, + KeyboardKeyNumpad7 = 0x6C, + KeyboardKeyNumpadEnter = 0x6D, + KeyboardKeyMediaMute = 0x6E, + KeyboardKeyNumpad0 = 0x70, + KeyboardKeyNumpadColon = 0x71, + KeyboardKeyNumpad2 = 0x72, + KeyboardKeyNumpad5 = 0x73, + KeyboardKeyNumpad6 = 0x74, + KeyboardKeyNumpad8 = 0x75, + KeyboardKeyEscape = 0x76, + KeyboardKeyNumLock = 0x77, + KeyboardKeyF11 = 0x78, + KeyboardKeyNumpadPlus = 0x79, + KeyboardKeyNumpad3 = 0x7A, + KeyboardKeyNumpadMinus = 0x7B, + KeyboardKeyNumpadAsterisk = 0x7C, + KeyboardKeyNumpad9 = 0x7D, + KeyboardKeyScrollLock = 0x7E +}; + +typedef struct { + char Character; + uint8 Scancode; +} Key; + +typedef struct { + uint8 Pressed; + char Character; + uint8 Scancode; +} KeyEvent; + +/**************************************** + * Other data types * + ****************************************/ +typedef struct { + int32 X, Y; +} Point; + +typedef struct +{ + uint32 X, Y; +} UPoint; + +typedef char* string; + +#endif \ No newline at end of file diff --git a/exp/luxOS/DEP~1.INC b/exp/luxOS/DEP~1.INC new file mode 100644 index 0000000..4560e55 --- /dev/null +++ b/exp/luxOS/DEP~1.INC @@ -0,0 +1,5 @@ +# This code depends on make tool being used +DEPFILES=$(wildcard $(addsuffix .d, ${OBJECTFILES})) +ifneq (${DEPFILES},) +include ${DEPFILES} +endif diff --git a/exp/luxOS/luxOS-Makefile.mk b/exp/luxOS/luxOS-Makefile.mk new file mode 100644 index 0000000..ec9de69 --- /dev/null +++ b/exp/luxOS/luxOS-Makefile.mk @@ -0,0 +1,128 @@ +# +# There exist several targets which are by default empty and which can be +# used for execution of your targets. These targets are usually executed +# before and after some main targets. They are: +# +# .build-pre: called before 'build' target +# .build-post: called after 'build' target +# .clean-pre: called before 'clean' target +# .clean-post: called after 'clean' target +# .clobber-pre: called before 'clobber' target +# .clobber-post: called after 'clobber' target +# .all-pre: called before 'all' target +# .all-post: called after 'all' target +# .help-pre: called before 'help' target +# .help-post: called after 'help' target +# +# Targets beginning with '.' are not intended to be called on their own. +# +# Main targets can be executed directly, and they are: +# +# build build a specific configuration +# clean remove built files from a configuration +# clobber remove all built files +# all build all configurations +# help print help mesage +# +# Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and +# .help-impl are implemented in nbproject/makefile-impl.mk. +# +# Available make variables: +# +# CND_BASEDIR base directory for relative paths +# CND_DISTDIR default top distribution directory (build artifacts) +# CND_BUILDDIR default top build directory (object files, ...) +# CONF name of current configuration +# CND_PLATFORM_${CONF} platform name (current configuration) +# CND_ARTIFACT_DIR_${CONF} directory of build artifact (current configuration) +# CND_ARTIFACT_NAME_${CONF} name of build artifact (current configuration) +# CND_ARTIFACT_PATH_${CONF} path to build artifact (current configuration) +# CND_PACKAGE_DIR_${CONF} directory of package (current configuration) +# CND_PACKAGE_NAME_${CONF} name of package (current configuration) +# CND_PACKAGE_PATH_${CONF} path to package (current configuration) +# +# NOCDDL + + +# Environment +MKDIR=mkdir +CP=cp +CCADMIN=CCadmin + + +# build +build: .build-post + +.build-pre: +# Add your pre 'build' code here... + +.build-post: .build-impl +# Add your post 'build' code here... + + +# clean +clean: .clean-post + +.clean-pre: +# Add your pre 'clean' code here... + +.clean-post: .clean-impl +# Add your post 'clean' code here... + + +# clobber +clobber: .clobber-post + +.clobber-pre: +# Add your pre 'clobber' code here... + +.clobber-post: .clobber-impl +# Add your post 'clobber' code here... + + +# all +all: .all-post + +.all-pre: +# Add your pre 'all' code here... + +.all-post: .all-impl +# Add your post 'all' code here... + + +# build tests +build-tests: .build-tests-post + +.build-tests-pre: +# Add your pre 'build-tests' code here... + +.build-tests-post: .build-tests-impl +# Add your post 'build-tests' code here... + + +# run tests +test: .test-post + +.test-pre: +# Add your pre 'test' code here... + +.test-post: .test-impl +# Add your post 'test' code here... + + +# help +help: .help-post + +.help-pre: +# Add your pre 'help' code here... + +.help-post: .help-impl +# Add your post 'help' code here... + + + +# include project implementation makefile +include nbproject/Makefile-impl.mk + +# include project make variables +include nbproject/Makefile-variables.mk diff --git a/exp/luxOS/nbproject/Makefile-Default.mk b/exp/luxOS/nbproject/Makefile-Default.mk new file mode 100644 index 0000000..e2d7b8e --- /dev/null +++ b/exp/luxOS/nbproject/Makefile-Default.mk @@ -0,0 +1,66 @@ +# +# Generated Makefile - do not edit! +# +# Edit the Makefile in the project folder instead (../Makefile). Each target +# has a -pre and a -post target defined where you can add customized code. +# +# This makefile implements configuration specific macros and targets. + + +# Environment +MKDIR=mkdir +CP=cp +GREP=grep +NM=nm +CCADMIN=CCadmin +RANLIB=ranlib +CC=gcc +CCC=g++ +CXX=g++ +FC= +AS=as + +# Macros +CND_PLATFORM=GNU-Linux-x86 +CND_CONF=Default +CND_DISTDIR=dist + +# Include project Makefile +include luxOS-Makefile.mk + +# Object Directory +OBJECTDIR=build/${CND_CONF}/${CND_PLATFORM} + +# Object Files +OBJECTFILES= + + +# C Compiler Flags +CFLAGS= + +# CC Compiler Flags +CCFLAGS= +CXXFLAGS= + +# Fortran Compiler Flags +FFLAGS= + +# Assembler Flags +ASFLAGS= + +# Link Libraries and Options +LDLIBSOPTIONS= + +# Build Targets +.build-conf: ${BUILD_SUBPROJECTS} + cd /home/tiberiu/lux && kdesudo sh build.sh + +# Subprojects +.build-subprojects: + +# Clean Targets +.clean-conf: ${CLEAN_SUBPROJECTS} + cd /home/tiberiu/lux && kdesudo sh build.sh + +# Subprojects +.clean-subprojects: diff --git a/exp/luxOS/nbproject/Makefile-impl.mk b/exp/luxOS/nbproject/Makefile-impl.mk new file mode 100644 index 0000000..26670b3 --- /dev/null +++ b/exp/luxOS/nbproject/Makefile-impl.mk @@ -0,0 +1,133 @@ +# +# Generated Makefile - do not edit! +# +# Edit the Makefile in the project folder instead (../Makefile). Each target +# has a pre- and a post- target defined where you can add customization code. +# +# This makefile implements macros and targets common to all configurations. +# +# NOCDDL + + +# Building and Cleaning subprojects are done by default, but can be controlled with the SUB +# macro. If SUB=no, subprojects will not be built or cleaned. The following macro +# statements set BUILD_SUB-CONF and CLEAN_SUB-CONF to .build-reqprojects-conf +# and .clean-reqprojects-conf unless SUB has the value 'no' +SUB_no=NO +SUBPROJECTS=${SUB_${SUB}} +BUILD_SUBPROJECTS_=.build-subprojects +BUILD_SUBPROJECTS_NO= +BUILD_SUBPROJECTS=${BUILD_SUBPROJECTS_${SUBPROJECTS}} +CLEAN_SUBPROJECTS_=.clean-subprojects +CLEAN_SUBPROJECTS_NO= +CLEAN_SUBPROJECTS=${CLEAN_SUBPROJECTS_${SUBPROJECTS}} + + +# Project Name +PROJECTNAME=luxOS + +# Active Configuration +DEFAULTCONF=Default +CONF=${DEFAULTCONF} + +# All Configurations +ALLCONFS=Default + + +# build +.build-impl: .build-pre .validate-impl .depcheck-impl + @#echo "=> Running $@... Configuration=$(CONF)" + "${MAKE}" -f nbproject/Makefile-${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .build-conf + + +# clean +.clean-impl: .clean-pre .validate-impl .depcheck-impl + @#echo "=> Running $@... Configuration=$(CONF)" + "${MAKE}" -f nbproject/Makefile-${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .clean-conf + + +# clobber +.clobber-impl: .clobber-pre .depcheck-impl + @#echo "=> Running $@..." + for CONF in ${ALLCONFS}; \ + do \ + "${MAKE}" -f nbproject/Makefile-$${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .clean-conf; \ + done + +# all +.all-impl: .all-pre .depcheck-impl + @#echo "=> Running $@..." + for CONF in ${ALLCONFS}; \ + do \ + "${MAKE}" -f nbproject/Makefile-$${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .build-conf; \ + done + +# build tests +.build-tests-impl: .build-impl .build-tests-pre + @#echo "=> Running $@... Configuration=$(CONF)" + "${MAKE}" -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .build-tests-conf + +# run tests +.test-impl: .build-tests-impl .test-pre + @#echo "=> Running $@... Configuration=$(CONF)" + "${MAKE}" -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .test-conf + +# dependency checking support +.depcheck-impl: + @echo "# This code depends on make tool being used" >.dep.inc + @if [ -n "${MAKE_VERSION}" ]; then \ + echo "DEPFILES=\$$(wildcard \$$(addsuffix .d, \$${OBJECTFILES}))" >>.dep.inc; \ + echo "ifneq (\$${DEPFILES},)" >>.dep.inc; \ + echo "include \$${DEPFILES}" >>.dep.inc; \ + echo "endif" >>.dep.inc; \ + else \ + echo ".KEEP_STATE:" >>.dep.inc; \ + echo ".KEEP_STATE_FILE:.make.state.\$${CONF}" >>.dep.inc; \ + fi + +# configuration validation +.validate-impl: + @if [ ! -f nbproject/Makefile-${CONF}.mk ]; \ + then \ + echo ""; \ + echo "Error: can not find the makefile for configuration '${CONF}' in project ${PROJECTNAME}"; \ + echo "See 'make help' for details."; \ + echo "Current directory: " `pwd`; \ + echo ""; \ + fi + @if [ ! -f nbproject/Makefile-${CONF}.mk ]; \ + then \ + exit 1; \ + fi + + +# help +.help-impl: .help-pre + @echo "This makefile supports the following configurations:" + @echo " ${ALLCONFS}" + @echo "" + @echo "and the following targets:" + @echo " build (default target)" + @echo " clean" + @echo " clobber" + @echo " all" + @echo " help" + @echo "" + @echo "Makefile Usage:" + @echo " make [CONF=] [SUB=no] build" + @echo " make [CONF=] [SUB=no] clean" + @echo " make [SUB=no] clobber" + @echo " make [SUB=no] all" + @echo " make help" + @echo "" + @echo "Target 'build' will build a specific configuration and, unless 'SUB=no'," + @echo " also build subprojects." + @echo "Target 'clean' will clean a specific configuration and, unless 'SUB=no'," + @echo " also clean subprojects." + @echo "Target 'clobber' will remove all built files from all configurations and," + @echo " unless 'SUB=no', also from subprojects." + @echo "Target 'all' will will build all configurations and, unless 'SUB=no'," + @echo " also build subprojects." + @echo "Target 'help' prints this message." + @echo "" + diff --git a/exp/luxOS/nbproject/Makefile-variables.mk b/exp/luxOS/nbproject/Makefile-variables.mk new file mode 100644 index 0000000..22be47c --- /dev/null +++ b/exp/luxOS/nbproject/Makefile-variables.mk @@ -0,0 +1,16 @@ +# +# Generated - do not edit! +# +# NOCDDL +# +CND_BASEDIR=`pwd` +CND_BUILDDIR=build +CND_DISTDIR=dist +# Default configuration +CND_PLATFORM_Default=GNU-Linux-x86 +CND_ARTIFACT_DIR_Default= +CND_ARTIFACT_NAME_Default= +CND_ARTIFACT_PATH_Default= +CND_PACKAGE_DIR_Default=dist/Default/GNU-Linux-x86/package +CND_PACKAGE_NAME_Default=luxOS.tar +CND_PACKAGE_PATH_Default=dist/Default/GNU-Linux-x86/package/luxOS.tar diff --git a/exp/luxOS/nbproject/Package-Default.bash b/exp/luxOS/nbproject/Package-Default.bash new file mode 100644 index 0000000..4215d6a --- /dev/null +++ b/exp/luxOS/nbproject/Package-Default.bash @@ -0,0 +1,74 @@ +#!/bin/bash -x + +# +# Generated - do not edit! +# + +# Macros +TOP=`pwd` +CND_PLATFORM=GNU-Linux-x86 +CND_CONF=Default +CND_DISTDIR=dist +NBTMPDIR=build/${CND_CONF}/${CND_PLATFORM}/tmp-packaging +TMPDIRNAME=tmp-packaging +OUTPUT_PATH=MissingOutputInProject +OUTPUT_BASENAME=MissingOutputInProject +PACKAGE_TOP_DIR=luxOS/ + +# Functions +function checkReturnCode +{ + rc=$? + if [ $rc != 0 ] + then + exit $rc + fi +} +function makeDirectory +# $1 directory path +# $2 permission (optional) +{ + mkdir -p "$1" + checkReturnCode + if [ "$2" != "" ] + then + chmod $2 "$1" + checkReturnCode + fi +} +function copyFileToTmpDir +# $1 from-file path +# $2 to-file path +# $3 permission +{ + cp "$1" "$2" + checkReturnCode + if [ "$3" != "" ] + then + chmod $3 "$2" + checkReturnCode + fi +} + +# Setup +cd "${TOP}" +mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package +rm -rf ${NBTMPDIR} +mkdir -p ${NBTMPDIR} + +# Copy files and create directories and links +cd "${TOP}" +makeDirectory "${NBTMPDIR}/luxOS/bin" +copyFileToTmpDir "${OUTPUT_PATH}" "${NBTMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755 + + +# Generate tar file +cd "${TOP}" +rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/luxOS.tar +cd ${NBTMPDIR} +tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/luxOS.tar * +checkReturnCode + +# Cleanup +cd "${TOP}" +rm -rf ${NBTMPDIR} diff --git a/exp/luxOS/nbproject/configurations.xml b/exp/luxOS/nbproject/configurations.xml new file mode 100644 index 0000000..def1514 --- /dev/null +++ b/exp/luxOS/nbproject/configurations.xml @@ -0,0 +1,118 @@ + + + + + + + + + console-base.c + console-in.c + console-out.c + console.c + + + + cmos.c + cmos.h + + + pit.c + pit.h + + drivers.c + drivers.h + + + + clock.c + clock.h + + + gdt.c + gdt.h + idt.c + idt.h + irq.c + irq.h + isrs.c + isrs.h + pic.c + pic.h + + + keyboard.c + keyboard.h + + + mouse.c + mouse.h + + hal.c + hal.h + + + ctype.h + debugio.h + memory.h + stdarg.h + stdio.h + stdlib.h + time.h + types.h + va_list.h + + + ctype.c + memory.c + stdio.c + stdlib.c + time.c + + + memory-ph.c + + main.c + + + + /home/tiberiu/lux/Makefile + /home/tiberiu/lux/build.sh + luxOS-Makefile.mk + + + + /home/tiberiu/lux + + luxOS-Makefile.mk + + + + localhost + GNU|GNU + 2 + + + + /home/tiberiu/lux + kdesudo sh build.sh + kdesudo sh build.sh + + + + /home/tiberiu/lux/Kernel/include + + + + + /home/tiberiu/lux/Kernel/include + + + + + + + diff --git a/exp/luxOS/nbproject/project.xml b/exp/luxOS/nbproject/project.xml new file mode 100644 index 0000000..006cd3e --- /dev/null +++ b/exp/luxOS/nbproject/project.xml @@ -0,0 +1,21 @@ + + + org.netbeans.modules.cnd.makeproject + + + luxOS + 0 + c + + h + UTF-8 + + + /home/tiberiu/lux + + + Default + + + + diff --git a/exp/luxTime/DEP~1.INC b/exp/luxTime/DEP~1.INC new file mode 100644 index 0000000..4560e55 --- /dev/null +++ b/exp/luxTime/DEP~1.INC @@ -0,0 +1,5 @@ +# This code depends on make tool being used +DEPFILES=$(wildcard $(addsuffix .d, ${OBJECTFILES})) +ifneq (${DEPFILES},) +include ${DEPFILES} +endif diff --git a/exp/luxTime/Makefile b/exp/luxTime/Makefile new file mode 100644 index 0000000..ec9de69 --- /dev/null +++ b/exp/luxTime/Makefile @@ -0,0 +1,128 @@ +# +# There exist several targets which are by default empty and which can be +# used for execution of your targets. These targets are usually executed +# before and after some main targets. They are: +# +# .build-pre: called before 'build' target +# .build-post: called after 'build' target +# .clean-pre: called before 'clean' target +# .clean-post: called after 'clean' target +# .clobber-pre: called before 'clobber' target +# .clobber-post: called after 'clobber' target +# .all-pre: called before 'all' target +# .all-post: called after 'all' target +# .help-pre: called before 'help' target +# .help-post: called after 'help' target +# +# Targets beginning with '.' are not intended to be called on their own. +# +# Main targets can be executed directly, and they are: +# +# build build a specific configuration +# clean remove built files from a configuration +# clobber remove all built files +# all build all configurations +# help print help mesage +# +# Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and +# .help-impl are implemented in nbproject/makefile-impl.mk. +# +# Available make variables: +# +# CND_BASEDIR base directory for relative paths +# CND_DISTDIR default top distribution directory (build artifacts) +# CND_BUILDDIR default top build directory (object files, ...) +# CONF name of current configuration +# CND_PLATFORM_${CONF} platform name (current configuration) +# CND_ARTIFACT_DIR_${CONF} directory of build artifact (current configuration) +# CND_ARTIFACT_NAME_${CONF} name of build artifact (current configuration) +# CND_ARTIFACT_PATH_${CONF} path to build artifact (current configuration) +# CND_PACKAGE_DIR_${CONF} directory of package (current configuration) +# CND_PACKAGE_NAME_${CONF} name of package (current configuration) +# CND_PACKAGE_PATH_${CONF} path to package (current configuration) +# +# NOCDDL + + +# Environment +MKDIR=mkdir +CP=cp +CCADMIN=CCadmin + + +# build +build: .build-post + +.build-pre: +# Add your pre 'build' code here... + +.build-post: .build-impl +# Add your post 'build' code here... + + +# clean +clean: .clean-post + +.clean-pre: +# Add your pre 'clean' code here... + +.clean-post: .clean-impl +# Add your post 'clean' code here... + + +# clobber +clobber: .clobber-post + +.clobber-pre: +# Add your pre 'clobber' code here... + +.clobber-post: .clobber-impl +# Add your post 'clobber' code here... + + +# all +all: .all-post + +.all-pre: +# Add your pre 'all' code here... + +.all-post: .all-impl +# Add your post 'all' code here... + + +# build tests +build-tests: .build-tests-post + +.build-tests-pre: +# Add your pre 'build-tests' code here... + +.build-tests-post: .build-tests-impl +# Add your post 'build-tests' code here... + + +# run tests +test: .test-post + +.test-pre: +# Add your pre 'test' code here... + +.test-post: .test-impl +# Add your post 'test' code here... + + +# help +help: .help-post + +.help-pre: +# Add your pre 'help' code here... + +.help-post: .help-impl +# Add your post 'help' code here... + + + +# include project implementation makefile +include nbproject/Makefile-impl.mk + +# include project make variables +include nbproject/Makefile-variables.mk diff --git a/exp/luxTime/main.c b/exp/luxTime/main.c new file mode 100644 index 0000000..02e96ce --- /dev/null +++ b/exp/luxTime/main.c @@ -0,0 +1,89 @@ +/* + * File: main.c + * Author: tiberiu + * + * Created on June 25, 2011, 7:32 PM + */ + +#include +#include + +typedef unsigned char uint8; +typedef unsigned short uint16; +typedef unsigned uint32; +typedef signed char int8; +typedef signed short int16; +typedef signed int int32; + +// User friendly time structure +typedef struct +{ + int32 Year; + uint8 Month, WeekDay, Day; // Day starts monday + uint8 Hour, Minute, Second; + uint16 Milisecond; +} Time; + +// System time structure +typedef struct { + uint32 Date, Time; +} TimeSystem; + +// Length of months (summed) +int16 MonthLen[] = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 }; + +TimeSystem InternalTime; + +void SetInternalTime (Time t) +{ + t.Year--; t.Month--; t.Day--; t.WeekDay--; + + InternalTime.Time = (uint32)(t.Hour * 3600000) + (uint32)(t.Minute * 60000) + (uint32)(t.Second * 1000) + (uint32)t.Milisecond; + + if (t.Year < 0) return; + + InternalTime.Date = (uint32)(t.Day) + (uint32)(MonthLen[t.Month]) + + + (uint32)((t.Year/4) * (365*4 + 1)) + (uint32)(t.Year%4 * 365); +} + +Time GetInternalTime () +{ + Time t; + t.Milisecond = InternalTime.Time % 1000; + t.Second = (InternalTime.Time / 1000) % 60; + t.Minute = (InternalTime.Time / 60000) % 60; + t.Hour = (InternalTime.Time / 3600000); + + + uint32 DayOfYear = (InternalTime.Date % 1461) % 365; + t.Year = (InternalTime.Date / 1461)*4 + (InternalTime.Date % 1461)/365 + 1; + t.Month = 11; + while (DayOfYear < (MonthLen[t.Month] + (t.Year % 4 == 0 && t.Month>1))) t.Month--; + t.WeekDay = InternalTime.Date % 7; + t.Day = DayOfYear - MonthLen[t.Month] - (t.Year % 4 == 0 && t.Month>1); + + t.Month++; t.WeekDay++; t.Day++; + + return t; +} + + +int main(int argc, char** argv) { + + // YYYY MM Wd DD HH MM SS MS + Time t = { 2000, 6, 2, 11, 11, 35, 11, 221 }; + + printf("Setting internal timer to %02u %02u %04u, %u:%02u:%02u.%03u, weekday=%u\n", + t.Day, t.Month, t.Year, t.Hour, t.Minute, t.Second, t.Milisecond, t.WeekDay); + + + SetInternalTime(t); + + t = GetInternalTime(); + printf("Internal timer values: %u %u\n", InternalTime.Date, InternalTime.Time); + printf("Received: %02u %02u %04u, %u:%02u:%02u.%03u, weekday=%u", + t.Day, t.Month, t.Year, t.Hour, t.Minute, t.Second, t.Milisecond, t.WeekDay); + + return 0; +} + diff --git a/exp/luxTime/nbproject/Makefile-Debug.mk b/exp/luxTime/nbproject/Makefile-Debug.mk new file mode 100644 index 0000000..9c1764a --- /dev/null +++ b/exp/luxTime/nbproject/Makefile-Debug.mk @@ -0,0 +1,82 @@ +# +# Generated Makefile - do not edit! +# +# Edit the Makefile in the project folder instead (../Makefile). Each target +# has a -pre and a -post target defined where you can add customized code. +# +# This makefile implements configuration specific macros and targets. + + +# Environment +MKDIR=mkdir +CP=cp +GREP=grep +NM=nm +CCADMIN=CCadmin +RANLIB=ranlib +CC=gcc +CCC=g++ +CXX=g++ +FC= +AS=as + +# Macros +CND_PLATFORM=GNU-Linux-x86 +CND_CONF=Debug +CND_DISTDIR=dist + +# Include project Makefile +include Makefile + +# Object Directory +OBJECTDIR=build/${CND_CONF}/${CND_PLATFORM} + +# Object Files +OBJECTFILES= \ + ${OBJECTDIR}/main.o + + +# C Compiler Flags +CFLAGS=-Wall + +# CC Compiler Flags +CCFLAGS=-Wall +CXXFLAGS=-Wall + +# Fortran Compiler Flags +FFLAGS= + +# Assembler Flags +ASFLAGS= + +# Link Libraries and Options +LDLIBSOPTIONS= + +# Build Targets +.build-conf: ${BUILD_SUBPROJECTS} + "${MAKE}" -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux-x86/luxtime + +dist/Debug/GNU-Linux-x86/luxtime: ${OBJECTFILES} + ${MKDIR} -p dist/Debug/GNU-Linux-x86 + ${LINK.c} -o ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/luxtime ${OBJECTFILES} ${LDLIBSOPTIONS} + +${OBJECTDIR}/main.o: main.c + ${MKDIR} -p ${OBJECTDIR} + ${RM} $@.d + $(COMPILE.c) -g -MMD -MP -MF $@.d -o ${OBJECTDIR}/main.o main.c + +# Subprojects +.build-subprojects: + +# Clean Targets +.clean-conf: ${CLEAN_SUBPROJECTS} + ${RM} -r build/Debug + ${RM} dist/Debug/GNU-Linux-x86/luxtime + +# Subprojects +.clean-subprojects: + +# Enable dependency checking +.dep.inc: .depcheck-impl + +include .dep.inc diff --git a/exp/luxTime/nbproject/Makefile-Release.mk b/exp/luxTime/nbproject/Makefile-Release.mk new file mode 100644 index 0000000..c1723db --- /dev/null +++ b/exp/luxTime/nbproject/Makefile-Release.mk @@ -0,0 +1,82 @@ +# +# Generated Makefile - do not edit! +# +# Edit the Makefile in the project folder instead (../Makefile). Each target +# has a -pre and a -post target defined where you can add customized code. +# +# This makefile implements configuration specific macros and targets. + + +# Environment +MKDIR=mkdir +CP=cp +GREP=grep +NM=nm +CCADMIN=CCadmin +RANLIB=ranlib +CC=gcc +CCC=g++ +CXX=g++ +FC= +AS=as + +# Macros +CND_PLATFORM=GNU-Linux-x86 +CND_CONF=Release +CND_DISTDIR=dist + +# Include project Makefile +include Makefile + +# Object Directory +OBJECTDIR=build/${CND_CONF}/${CND_PLATFORM} + +# Object Files +OBJECTFILES= \ + ${OBJECTDIR}/main.o + + +# C Compiler Flags +CFLAGS= + +# CC Compiler Flags +CCFLAGS= +CXXFLAGS= + +# Fortran Compiler Flags +FFLAGS= + +# Assembler Flags +ASFLAGS= + +# Link Libraries and Options +LDLIBSOPTIONS= + +# Build Targets +.build-conf: ${BUILD_SUBPROJECTS} + "${MAKE}" -f nbproject/Makefile-Release.mk dist/Release/GNU-Linux-x86/luxtime + +dist/Release/GNU-Linux-x86/luxtime: ${OBJECTFILES} + ${MKDIR} -p dist/Release/GNU-Linux-x86 + ${LINK.c} -o ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/luxtime ${OBJECTFILES} ${LDLIBSOPTIONS} + +${OBJECTDIR}/main.o: main.c + ${MKDIR} -p ${OBJECTDIR} + ${RM} $@.d + $(COMPILE.c) -O2 -MMD -MP -MF $@.d -o ${OBJECTDIR}/main.o main.c + +# Subprojects +.build-subprojects: + +# Clean Targets +.clean-conf: ${CLEAN_SUBPROJECTS} + ${RM} -r build/Release + ${RM} dist/Release/GNU-Linux-x86/luxtime + +# Subprojects +.clean-subprojects: + +# Enable dependency checking +.dep.inc: .depcheck-impl + +include .dep.inc diff --git a/exp/luxTime/nbproject/Makefile-impl.mk b/exp/luxTime/nbproject/Makefile-impl.mk new file mode 100644 index 0000000..80d143b --- /dev/null +++ b/exp/luxTime/nbproject/Makefile-impl.mk @@ -0,0 +1,133 @@ +# +# Generated Makefile - do not edit! +# +# Edit the Makefile in the project folder instead (../Makefile). Each target +# has a pre- and a post- target defined where you can add customization code. +# +# This makefile implements macros and targets common to all configurations. +# +# NOCDDL + + +# Building and Cleaning subprojects are done by default, but can be controlled with the SUB +# macro. If SUB=no, subprojects will not be built or cleaned. The following macro +# statements set BUILD_SUB-CONF and CLEAN_SUB-CONF to .build-reqprojects-conf +# and .clean-reqprojects-conf unless SUB has the value 'no' +SUB_no=NO +SUBPROJECTS=${SUB_${SUB}} +BUILD_SUBPROJECTS_=.build-subprojects +BUILD_SUBPROJECTS_NO= +BUILD_SUBPROJECTS=${BUILD_SUBPROJECTS_${SUBPROJECTS}} +CLEAN_SUBPROJECTS_=.clean-subprojects +CLEAN_SUBPROJECTS_NO= +CLEAN_SUBPROJECTS=${CLEAN_SUBPROJECTS_${SUBPROJECTS}} + + +# Project Name +PROJECTNAME=luxTime + +# Active Configuration +DEFAULTCONF=Debug +CONF=${DEFAULTCONF} + +# All Configurations +ALLCONFS=Debug Release + + +# build +.build-impl: .build-pre .validate-impl .depcheck-impl + @#echo "=> Running $@... Configuration=$(CONF)" + "${MAKE}" -f nbproject/Makefile-${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .build-conf + + +# clean +.clean-impl: .clean-pre .validate-impl .depcheck-impl + @#echo "=> Running $@... Configuration=$(CONF)" + "${MAKE}" -f nbproject/Makefile-${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .clean-conf + + +# clobber +.clobber-impl: .clobber-pre .depcheck-impl + @#echo "=> Running $@..." + for CONF in ${ALLCONFS}; \ + do \ + "${MAKE}" -f nbproject/Makefile-$${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .clean-conf; \ + done + +# all +.all-impl: .all-pre .depcheck-impl + @#echo "=> Running $@..." + for CONF in ${ALLCONFS}; \ + do \ + "${MAKE}" -f nbproject/Makefile-$${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .build-conf; \ + done + +# build tests +.build-tests-impl: .build-impl .build-tests-pre + @#echo "=> Running $@... Configuration=$(CONF)" + "${MAKE}" -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .build-tests-conf + +# run tests +.test-impl: .build-tests-impl .test-pre + @#echo "=> Running $@... Configuration=$(CONF)" + "${MAKE}" -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .test-conf + +# dependency checking support +.depcheck-impl: + @echo "# This code depends on make tool being used" >.dep.inc + @if [ -n "${MAKE_VERSION}" ]; then \ + echo "DEPFILES=\$$(wildcard \$$(addsuffix .d, \$${OBJECTFILES}))" >>.dep.inc; \ + echo "ifneq (\$${DEPFILES},)" >>.dep.inc; \ + echo "include \$${DEPFILES}" >>.dep.inc; \ + echo "endif" >>.dep.inc; \ + else \ + echo ".KEEP_STATE:" >>.dep.inc; \ + echo ".KEEP_STATE_FILE:.make.state.\$${CONF}" >>.dep.inc; \ + fi + +# configuration validation +.validate-impl: + @if [ ! -f nbproject/Makefile-${CONF}.mk ]; \ + then \ + echo ""; \ + echo "Error: can not find the makefile for configuration '${CONF}' in project ${PROJECTNAME}"; \ + echo "See 'make help' for details."; \ + echo "Current directory: " `pwd`; \ + echo ""; \ + fi + @if [ ! -f nbproject/Makefile-${CONF}.mk ]; \ + then \ + exit 1; \ + fi + + +# help +.help-impl: .help-pre + @echo "This makefile supports the following configurations:" + @echo " ${ALLCONFS}" + @echo "" + @echo "and the following targets:" + @echo " build (default target)" + @echo " clean" + @echo " clobber" + @echo " all" + @echo " help" + @echo "" + @echo "Makefile Usage:" + @echo " make [CONF=] [SUB=no] build" + @echo " make [CONF=] [SUB=no] clean" + @echo " make [SUB=no] clobber" + @echo " make [SUB=no] all" + @echo " make help" + @echo "" + @echo "Target 'build' will build a specific configuration and, unless 'SUB=no'," + @echo " also build subprojects." + @echo "Target 'clean' will clean a specific configuration and, unless 'SUB=no'," + @echo " also clean subprojects." + @echo "Target 'clobber' will remove all built files from all configurations and," + @echo " unless 'SUB=no', also from subprojects." + @echo "Target 'all' will will build all configurations and, unless 'SUB=no'," + @echo " also build subprojects." + @echo "Target 'help' prints this message." + @echo "" + diff --git a/exp/luxTime/nbproject/Makefile-variables.mk b/exp/luxTime/nbproject/Makefile-variables.mk new file mode 100644 index 0000000..f507a3a --- /dev/null +++ b/exp/luxTime/nbproject/Makefile-variables.mk @@ -0,0 +1,24 @@ +# +# Generated - do not edit! +# +# NOCDDL +# +CND_BASEDIR=`pwd` +CND_BUILDDIR=build +CND_DISTDIR=dist +# Debug configuration +CND_PLATFORM_Debug=GNU-Linux-x86 +CND_ARTIFACT_DIR_Debug=dist/Debug/GNU-Linux-x86 +CND_ARTIFACT_NAME_Debug=luxtime +CND_ARTIFACT_PATH_Debug=dist/Debug/GNU-Linux-x86/luxtime +CND_PACKAGE_DIR_Debug=dist/Debug/GNU-Linux-x86/package +CND_PACKAGE_NAME_Debug=luxtime.tar +CND_PACKAGE_PATH_Debug=dist/Debug/GNU-Linux-x86/package/luxtime.tar +# Release configuration +CND_PLATFORM_Release=GNU-Linux-x86 +CND_ARTIFACT_DIR_Release=dist/Release/GNU-Linux-x86 +CND_ARTIFACT_NAME_Release=luxtime +CND_ARTIFACT_PATH_Release=dist/Release/GNU-Linux-x86/luxtime +CND_PACKAGE_DIR_Release=dist/Release/GNU-Linux-x86/package +CND_PACKAGE_NAME_Release=luxtime.tar +CND_PACKAGE_PATH_Release=dist/Release/GNU-Linux-x86/package/luxtime.tar diff --git a/exp/luxTime/nbproject/Package-Debug.bash b/exp/luxTime/nbproject/Package-Debug.bash new file mode 100644 index 0000000..51fb2e4 --- /dev/null +++ b/exp/luxTime/nbproject/Package-Debug.bash @@ -0,0 +1,74 @@ +#!/bin/bash -x + +# +# Generated - do not edit! +# + +# Macros +TOP=`pwd` +CND_PLATFORM=GNU-Linux-x86 +CND_CONF=Debug +CND_DISTDIR=dist +NBTMPDIR=build/${CND_CONF}/${CND_PLATFORM}/tmp-packaging +TMPDIRNAME=tmp-packaging +OUTPUT_PATH=${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/luxtime +OUTPUT_BASENAME=luxtime +PACKAGE_TOP_DIR=luxtime/ + +# Functions +function checkReturnCode +{ + rc=$? + if [ $rc != 0 ] + then + exit $rc + fi +} +function makeDirectory +# $1 directory path +# $2 permission (optional) +{ + mkdir -p "$1" + checkReturnCode + if [ "$2" != "" ] + then + chmod $2 "$1" + checkReturnCode + fi +} +function copyFileToTmpDir +# $1 from-file path +# $2 to-file path +# $3 permission +{ + cp "$1" "$2" + checkReturnCode + if [ "$3" != "" ] + then + chmod $3 "$2" + checkReturnCode + fi +} + +# Setup +cd "${TOP}" +mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package +rm -rf ${NBTMPDIR} +mkdir -p ${NBTMPDIR} + +# Copy files and create directories and links +cd "${TOP}" +makeDirectory "${NBTMPDIR}/luxtime/bin" +copyFileToTmpDir "${OUTPUT_PATH}" "${NBTMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755 + + +# Generate tar file +cd "${TOP}" +rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/luxtime.tar +cd ${NBTMPDIR} +tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/luxtime.tar * +checkReturnCode + +# Cleanup +cd "${TOP}" +rm -rf ${NBTMPDIR} diff --git a/exp/luxTime/nbproject/Package-Release.bash b/exp/luxTime/nbproject/Package-Release.bash new file mode 100644 index 0000000..e068662 --- /dev/null +++ b/exp/luxTime/nbproject/Package-Release.bash @@ -0,0 +1,74 @@ +#!/bin/bash -x + +# +# Generated - do not edit! +# + +# Macros +TOP=`pwd` +CND_PLATFORM=GNU-Linux-x86 +CND_CONF=Release +CND_DISTDIR=dist +NBTMPDIR=build/${CND_CONF}/${CND_PLATFORM}/tmp-packaging +TMPDIRNAME=tmp-packaging +OUTPUT_PATH=${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/luxtime +OUTPUT_BASENAME=luxtime +PACKAGE_TOP_DIR=luxtime/ + +# Functions +function checkReturnCode +{ + rc=$? + if [ $rc != 0 ] + then + exit $rc + fi +} +function makeDirectory +# $1 directory path +# $2 permission (optional) +{ + mkdir -p "$1" + checkReturnCode + if [ "$2" != "" ] + then + chmod $2 "$1" + checkReturnCode + fi +} +function copyFileToTmpDir +# $1 from-file path +# $2 to-file path +# $3 permission +{ + cp "$1" "$2" + checkReturnCode + if [ "$3" != "" ] + then + chmod $3 "$2" + checkReturnCode + fi +} + +# Setup +cd "${TOP}" +mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package +rm -rf ${NBTMPDIR} +mkdir -p ${NBTMPDIR} + +# Copy files and create directories and links +cd "${TOP}" +makeDirectory "${NBTMPDIR}/luxtime/bin" +copyFileToTmpDir "${OUTPUT_PATH}" "${NBTMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755 + + +# Generate tar file +cd "${TOP}" +rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/luxtime.tar +cd ${NBTMPDIR} +tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/luxtime.tar * +checkReturnCode + +# Cleanup +cd "${TOP}" +rm -rf ${NBTMPDIR} diff --git a/exp/luxTime/nbproject/configurations.xml b/exp/luxTime/nbproject/configurations.xml new file mode 100644 index 0000000..c53014d --- /dev/null +++ b/exp/luxTime/nbproject/configurations.xml @@ -0,0 +1,71 @@ + + + + + + + + + main.c + + + + + Makefile + + + Makefile + + + + localhost + GNU|GNU + 2 + + + + -Wall + + + -Wall + + + + + + localhost + GNU|GNU + 2 + + + + 5 + + + 5 + + + 5 + + + 5 + + + + + diff --git a/exp/luxTime/nbproject/project.xml b/exp/luxTime/nbproject/project.xml new file mode 100644 index 0000000..15d6914 --- /dev/null +++ b/exp/luxTime/nbproject/project.xml @@ -0,0 +1,20 @@ + + + org.netbeans.modules.cnd.makeproject + + + luxTime + 0 + c + + + UTF-8 + + + + Debug + Release + + + +