[freenos] 2 new revisions pushed by nieklinn...@xxxxxxxxx on 2015-01-24 22:08 GMT

  • From: freenos@xxxxxxxxxxxxxx
  • To: freenos@xxxxxxxxxxxxx
  • Date: Sat, 24 Jan 2015 22:09:07 +0000

0.1.0-devel moved from 07dae5579c3a to 11151ba66a2c

2 new revisions:

Revision: c59fffdfb330
Author:   Niek Linnenbank <nieklinnenbank@xxxxxxxxx>
Date:     Fri Jan 23 22:41:20 2015 UTC
Log:      Rename Config.h to ProcessID.h
https://code.google.com/p/freenos/source/detail?r=c59fffdfb330

Revision: 11151ba66a2c
Author:   Niek Linnenbank <nieklinnenbank@xxxxxxxxx>
Date:     Sat Jan 24 22:07:29 2015 UTC
Log:      Rewrote generation code for Config.h and HostConfig.h
https://code.google.com/p/freenos/source/detail?r=11151ba66a2c

==============================================================================
Revision: c59fffdfb330
Author:   Niek Linnenbank <nieklinnenbank@xxxxxxxxx>
Date:     Fri Jan 23 22:41:20 2015 UTC
Log:      Rename Config.h to ProcessID.h

https://code.google.com/p/freenos/source/detail?r=c59fffdfb330

Added:
 /include/ProcessID.h
Deleted:
 /include/Config.h
Modified:
 /bin/bench/Main.cpp
 /bin/init/Main.cpp
 /bin/memstat/Main.cpp
 /bin/sh/Main.cpp
 /include/API/IPCMessage.h
 /include/Shared.h
 /kernel/API/IPCMessage.cpp
 /kernel/API/VMCtl.cpp
 /kernel/Process.cpp
 /lib/liballoc/PageAllocator.cpp
 /lib/liballoc/VMCtlAllocator.cpp
 /lib/libc/stdlib/exit.cpp
 /lib/libcrt/Assert.cpp
 /lib/libposix/dirent/opendir.cpp
 /lib/libposix/fcntl/open.cpp
 /lib/libposix/sys/stat/creat.cpp
 /lib/libposix/sys/stat/mkdir.cpp
 /lib/libposix/sys/stat/mknod.cpp
 /lib/libposix/sys/stat/stat.cpp
 /lib/libposix/unistd/close.cpp
 /lib/libposix/unistd/fork.cpp
 /lib/libposix/unistd/forkexec.cpp
 /lib/libposix/unistd/getpid.cpp
 /lib/libposix/unistd/lseek.cpp
 /lib/libposix/unistd/read.cpp
 /lib/libposix/unistd/write.cpp
 /site_scons/version.py
 /srv/IPCServer.h
 /srv/filesystem/BootModule.h
 /srv/filesystem/FileSystem.h
 /srv/filesystem/grub/GRUBModule.h
 /srv/input/keyboard/Keyboard.cpp
 /srv/pci/PCIServer.cpp
 /srv/process/ExitProcess.cpp
 /srv/process/ProcessMessage.h
 /srv/process/ProcessServer.cpp
 /srv/process/SetCurrentDirectory.cpp
 /srv/process/WaitProcess.cpp
 /srv/serial/i8250.cpp
 /srv/time/Time.cpp
 /srv/usb/uhci/UHCIController.cpp

=======================================
--- /dev/null
+++ /include/ProcessID.h        Fri Jan 23 22:41:20 2015 UTC
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2009 Niek Linnenbank
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+/**
+ * @brief Static PIDS.
+ * @{
+ */
+
+#define ANY            65535
+#define SELF           65534
+#define KERNEL_PID     65533
+
+#define PROCSRV_PID    0
+#define MEMSRV_PID     1
+#define DEVSRV_PID     2
+#define ROOTSRV_PID    3
+
+/**
+ * @}
+ */
+
+#endif /* __CONFIG_H */
=======================================
--- /include/Config.h   Sun Aug  2 10:44:51 2009 UTC
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2009 Niek Linnenbank
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef __CONFIG_H
-#define __CONFIG_H
-
-/**
- * @brief Static PIDS.
- * @{
- */
-
-#define ANY            65535
-#define SELF           65534
-#define KERNEL_PID     65533
-
-#define PROCSRV_PID    0
-#define MEMSRV_PID     1
-#define DEVSRV_PID     2
-#define ROOTSRV_PID    3
-
-/**
- * @}
- */
-
-#endif /* __CONFIG_H */
=======================================
--- /bin/bench/Main.cpp Sun Aug  2 11:44:02 2009 UTC
+++ /bin/bench/Main.cpp Fri Jan 23 22:41:20 2015 UTC
@@ -20,7 +20,7 @@
 #include <API/IPCMessage.h>
 #include <API/VMCtl.h>
 #include <MemoryMessage.h>
-#include <Config.h>
+#include <ProcessID.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <fcntl.h>
=======================================
--- /bin/init/Main.cpp  Thu Jan 22 18:31:11 2015 UTC
+++ /bin/init/Main.cpp  Fri Jan 23 22:41:20 2015 UTC
@@ -16,7 +16,7 @@
  */
 #include <API/ProcessCtl.h>
 #include <Macros.h>
-#include <Config.h>
+#include <ProcessID.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
=======================================
--- /bin/memstat/Main.cpp       Sun Aug  2 11:43:01 2009 UTC
+++ /bin/memstat/Main.cpp       Fri Jan 23 22:41:20 2015 UTC
@@ -16,7 +16,7 @@
  */

 #include <MemoryMessage.h>
-#include <Config.h>
+#include <ProcessID.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <fcntl.h>
=======================================
--- /bin/sh/Main.cpp    Sun Aug  2 11:40:49 2009 UTC
+++ /bin/sh/Main.cpp    Fri Jan 23 22:41:20 2015 UTC
@@ -16,7 +16,7 @@
  */

 #include <API/ProcessCtl.h>
-#include <Config.h>
+#include <ProcessID.h>
 #include <StringTokenizer.h>
 #include "Shell.h"
 #include <stdio.h>
=======================================
--- /include/API/IPCMessage.h   Sun Jun 28 13:55:59 2009 UTC
+++ /include/API/IPCMessage.h   Fri Jan 23 22:41:20 2015 UTC
@@ -23,7 +23,7 @@
 #include <Macros.h>
 #include <Types.h>
 #include <Error.h>
-#include <Config.h>
+#include <ProcessID.h>
 #include <string.h>

 /**
=======================================
--- /include/Shared.h   Sat Oct 24 20:14:36 2009 UTC
+++ /include/Shared.h   Fri Jan 23 22:41:20 2015 UTC
@@ -23,7 +23,7 @@
 #include "Comparable.h"
 #include "Types.h"
 #include "String.h"
-#include "Config.h"
+#include "ProcessID.h"

 /**
  * Enables sharing objects between processes.
=======================================
--- /kernel/API/IPCMessage.cpp  Sun Aug  2 10:48:33 2009 UTC
+++ /kernel/API/IPCMessage.cpp  Fri Jan 23 22:41:20 2015 UTC
@@ -20,7 +20,7 @@
 #include <FreeNOS/Init.h>
 #include <FreeNOS/Memory.h>
 #include <FreeNOS/Scheduler.h>
-#include <Config.h>
+#include <ProcessID.h>
 #include <Error.h>

int IPCMessageHandler(ProcessID id, Operation action, UserMessage *msg, Size size)
=======================================
--- /kernel/API/VMCtl.cpp       Sun Aug  2 10:42:22 2009 UTC
+++ /kernel/API/VMCtl.cpp       Fri Jan 23 22:41:20 2015 UTC
@@ -17,7 +17,7 @@

 #include <API/VMCtl.h>
 #include <Error.h>
-#include <Config.h>
+#include <ProcessID.h>

Error VMCtlHandler(ProcessID procID, MemoryOperation op, MemoryRange *range)
 {
=======================================
--- /kernel/Process.cpp Fri Jun 19 09:32:13 2009 UTC
+++ /kernel/Process.cpp Fri Jan 23 22:41:20 2015 UTC
@@ -18,7 +18,7 @@
 #include <FreeNOS/Process.h>
 #include <Array.h>
 #include <Types.h>
-#include <Config.h>
+#include <ProcessID.h>
 #include <ListIterator.h>

 Array<Process> Process::procs(MAX_PROCS);
=======================================
--- /lib/liballoc/PageAllocator.cpp     Sun Aug  2 10:58:47 2009 UTC
+++ /lib/liballoc/PageAllocator.cpp     Fri Jan 23 22:41:20 2015 UTC
@@ -18,7 +18,7 @@
 #include <API/IPCMessage.h>
 #include <API/ProcessCtl.h>
 #include <MemoryMessage.h>
-#include <Config.h>
+#include <ProcessID.h>
 #include "PageAllocator.h"

 PageAllocator::PageAllocator(Size size)
=======================================
--- /lib/liballoc/VMCtlAllocator.cpp    Sun Aug  2 10:57:29 2009 UTC
+++ /lib/liballoc/VMCtlAllocator.cpp    Fri Jan 23 22:41:20 2015 UTC
@@ -19,7 +19,7 @@
 #include <API/ProcessCtl.h>
 #include <FreeNOS/Memory.h>
 #include <Macros.h>
-#include <Config.h>
+#include <ProcessID.h>
 #include "VMCtlAllocator.h"

 VMCtlAllocator::VMCtlAllocator(Size size)
=======================================
--- /lib/libc/stdlib/exit.cpp   Sun Aug  2 11:31:33 2009 UTC
+++ /lib/libc/stdlib/exit.cpp   Fri Jan 23 22:41:20 2015 UTC
@@ -17,7 +17,7 @@

 #include <API/IPCMessage.h>
 #include <ProcessMessage.h>
-#include <Config.h>
+#include <ProcessID.h>
 #include "stdlib.h"

 void exit(int status)
=======================================
--- /lib/libcrt/Assert.cpp      Sun Aug  2 10:53:42 2009 UTC
+++ /lib/libcrt/Assert.cpp      Fri Jan 23 22:41:20 2015 UTC
@@ -20,7 +20,7 @@
 #include <Assert.h>
 #include <Macros.h>
 #include <Types.h>
-#include <Config.h>
+#include <ProcessID.h>
 #include <stdio.h>
 #include <stdarg.h>
 #include <stdlib.h>
=======================================
--- /lib/libposix/dirent/opendir.cpp    Sun Aug  2 11:34:12 2009 UTC
+++ /lib/libposix/dirent/opendir.cpp    Fri Jan 23 22:41:20 2015 UTC
@@ -16,7 +16,7 @@
  */

 #include <API/IPCMessage.h>
-#include <Config.h>
+#include <ProcessID.h>
 #include <FileType.h>
 #include <Directory.h>
 #include <errno.h>
=======================================
--- /lib/libposix/fcntl/open.cpp        Sun Aug  2 11:34:12 2009 UTC
+++ /lib/libposix/fcntl/open.cpp        Fri Jan 23 22:41:20 2015 UTC
@@ -17,7 +17,7 @@

 #include <API/IPCMessage.h>
 #include <FileSystemMessage.h>
-#include <Config.h>
+#include <ProcessID.h>
 #include "POSIXSupport.h"
 #include <errno.h>
 #include "fcntl.h"
=======================================
--- /lib/libposix/sys/stat/creat.cpp    Sun Aug 17 18:54:16 2014 UTC
+++ /lib/libposix/sys/stat/creat.cpp    Fri Jan 23 22:41:20 2015 UTC
@@ -19,7 +19,7 @@
 #include <FileSystemMessage.h>
 #include <FileType.h>
 #include <FileMode.h>
-#include <Config.h>
+#include <ProcessID.h>
 #include "POSIXSupport.h"
 #include <errno.h>
 #include "sys/stat.h"
=======================================
--- /lib/libposix/sys/stat/mkdir.cpp    Thu Aug 13 20:18:29 2009 UTC
+++ /lib/libposix/sys/stat/mkdir.cpp    Fri Jan 23 22:41:20 2015 UTC
@@ -17,7 +17,7 @@

 #include <API/IPCMessage.h>
 #include <FileSystemMessage.h>
-#include <Config.h>
+#include <ProcessID.h>
 #include "POSIXSupport.h"
 #include <errno.h>
 #include "sys/stat.h"
=======================================
--- /lib/libposix/sys/stat/mknod.cpp    Sun Aug  2 11:34:12 2009 UTC
+++ /lib/libposix/sys/stat/mknod.cpp    Fri Jan 23 22:41:20 2015 UTC
@@ -19,7 +19,7 @@
 #include <FileSystemMessage.h>
 #include <FileType.h>
 #include <FileMode.h>
-#include <Config.h>
+#include <ProcessID.h>
 #include "POSIXSupport.h"
 #include <errno.h>
 #include "sys/stat.h"
=======================================
--- /lib/libposix/sys/stat/stat.cpp     Sun Aug  2 11:34:12 2009 UTC
+++ /lib/libposix/sys/stat/stat.cpp     Fri Jan 23 22:41:20 2015 UTC
@@ -17,7 +17,7 @@

 #include <API/IPCMessage.h>
 #include <FileSystemMessage.h>
-#include <Config.h>
+#include <ProcessID.h>
 #include "POSIXSupport.h"
 #include <errno.h>
 #include "sys/stat.h"
=======================================
--- /lib/libposix/unistd/close.cpp      Sun Aug  2 11:34:12 2009 UTC
+++ /lib/libposix/unistd/close.cpp      Fri Jan 23 22:41:20 2015 UTC
@@ -17,7 +17,7 @@

 #include <API/IPCMessage.h>
 #include <FileSystemMessage.h>
-#include <Config.h>
+#include <ProcessID.h>
 #include "POSIXSupport.h"
 #include <errno.h>
 #include "unistd.h"
=======================================
--- /lib/libposix/unistd/fork.cpp       Sun Aug  2 11:34:12 2009 UTC
+++ /lib/libposix/unistd/fork.cpp       Fri Jan 23 22:41:20 2015 UTC
@@ -18,7 +18,7 @@
 #include <API/IPCMessage.h>
 #include <ProcessServer.h>
 #include <FileDescriptor.h>
-#include <Config.h>
+#include <ProcessID.h>
 #include "POSIXSupport.h"
 #include <errno.h>
 #include "unistd.h"
=======================================
--- /lib/libposix/unistd/forkexec.cpp   Sun Aug  2 11:34:12 2009 UTC
+++ /lib/libposix/unistd/forkexec.cpp   Fri Jan 23 22:41:20 2015 UTC
@@ -19,7 +19,7 @@
 #include <FreeNOS/Memory.h>
 #include <ProcessServer.h>
 #include <ProcessMessage.h>
-#include <Config.h>
+#include <ProcessID.h>
 #include <Types.h>
 #include <string.h>
 #include <errno.h>
=======================================
--- /lib/libposix/unistd/getpid.cpp     Sun Aug  2 11:34:12 2009 UTC
+++ /lib/libposix/unistd/getpid.cpp     Fri Jan 23 22:41:20 2015 UTC
@@ -16,7 +16,7 @@
  */

 #include <API/ProcessCtl.h>
-#include <Config.h>
+#include <ProcessID.h>
 #include "unistd.h"

 pid_t getpid()
=======================================
--- /lib/libposix/unistd/lseek.cpp      Sun Aug  2 11:34:12 2009 UTC
+++ /lib/libposix/unistd/lseek.cpp      Fri Jan 23 22:41:20 2015 UTC
@@ -17,7 +17,7 @@

 #include <API/IPCMessage.h>
 #include <FileSystemMessage.h>
-#include <Config.h>
+#include <ProcessID.h>
 #include "POSIXSupport.h"
 #include <errno.h>
 #include "unistd.h"
=======================================
--- /lib/libposix/unistd/read.cpp       Fri Aug  7 22:34:17 2009 UTC
+++ /lib/libposix/unistd/read.cpp       Fri Jan 23 22:41:20 2015 UTC
@@ -18,7 +18,7 @@
 #include <API/IPCMessage.h>
 #include <FileSystemMessage.h>
 #include "POSIXSupport.h"
-#include <Config.h>
+#include <ProcessID.h>
 #include <errno.h>
 #include "unistd.h"

=======================================
--- /lib/libposix/unistd/write.cpp      Fri Aug  7 22:34:17 2009 UTC
+++ /lib/libposix/unistd/write.cpp      Fri Jan 23 22:41:20 2015 UTC
@@ -18,7 +18,7 @@
 #include <API/IPCMessage.h>
 #include <FileSystemMessage.h>
 #include "POSIXSupport.h"
-#include <Config.h>
+#include <ProcessID.h>
 #include <errno.h>
 #include "unistd.h"

=======================================
--- /site_scons/version.py      Wed Jan 21 18:25:37 2015 UTC
+++ /site_scons/version.py      Fri Jan 23 22:41:20 2015 UTC
@@ -77,6 +77,7 @@
 def escape(obj):
     return str(obj).replace('"', '\\"')

+
 #
 # Write all gathered data to the version.h file.
 #
=======================================
--- /srv/IPCServer.h    Fri Jun 19 09:32:13 2009 UTC
+++ /srv/IPCServer.h    Fri Jan 23 22:41:20 2015 UTC
@@ -20,7 +20,7 @@

 #include <API/IPCMessage.h>
 #include <Error.h>
-#include <Config.h>
+#include <ProcessID.h>

 /**
  * Message handler function (dummy) container.
=======================================
--- /srv/filesystem/BootModule.h        Sun Aug  2 12:20:39 2009 UTC
+++ /srv/filesystem/BootModule.h        Fri Jan 23 22:41:20 2015 UTC
@@ -22,7 +22,7 @@
 #include <MemoryMessage.h>
 #include <Types.h>
 #include <Error.h>
-#include <Config.h>
+#include <ProcessID.h>
 #include "Storage.h"
 #include <string.h>

=======================================
--- /srv/filesystem/FileSystem.h        Tue Aug 18 20:56:08 2009 UTC
+++ /srv/filesystem/FileSystem.h        Fri Jan 23 22:41:20 2015 UTC
@@ -22,7 +22,7 @@
 #include <API/VMCopy.h>
 #include <IPCServer.h>
 #include <UserProcess.h>
-#include <Config.h>
+#include <ProcessID.h>
 #include <Shared.h>
 #include <Array.h>
 #include <HashTable.h>
=======================================
--- /srv/filesystem/grub/GRUBModule.h   Fri Sep  4 14:53:55 2009 UTC
+++ /srv/filesystem/grub/GRUBModule.h   Fri Jan 23 22:41:20 2015 UTC
@@ -22,7 +22,7 @@
 #include <PseudoFile.h>
 #include <Types.h>
 #include <Error.h>
-#include <Config.h>
+#include <ProcessID.h>

 /**
  * @brief GRUB Boot Module File.
=======================================
--- /srv/input/keyboard/Keyboard.cpp    Sun Aug  2 11:56:56 2009 UTC
+++ /srv/input/keyboard/Keyboard.cpp    Fri Jan 23 22:41:20 2015 UTC
@@ -18,7 +18,7 @@
 #include <API/ProcessCtl.h>
 #include <Macros.h>
 #include <Error.h>
-#include <Config.h>
+#include <ProcessID.h>
 #include "Keyboard.h"

 /**
=======================================
--- /srv/pci/PCIServer.cpp      Sun Aug 30 19:31:31 2009 UTC
+++ /srv/pci/PCIServer.cpp      Fri Jan 23 22:41:20 2015 UTC
@@ -16,7 +16,7 @@
  */

 #include <API/ProcessCtl.h>
-#include <Config.h>
+#include <ProcessID.h>
 #include "PCIRegister.h"
 #include "PCIConfig.h"
 #include "PCIServer.h"
=======================================
--- /srv/process/ExitProcess.cpp        Sun Aug  2 12:03:39 2009 UTC
+++ /srv/process/ExitProcess.cpp        Fri Jan 23 22:41:20 2015 UTC
@@ -19,7 +19,7 @@
 #include <API/ProcessCtl.h>
 #include <FreeNOS/Process.h>
 #include <Types.h>
-#include <Config.h>
+#include <ProcessID.h>
 #include <Error.h>
 #include "ProcessMessage.h"
 #include "ProcessServer.h"
=======================================
--- /srv/process/ProcessMessage.h       Sat Sep  5 23:08:03 2009 UTC
+++ /srv/process/ProcessMessage.h       Fri Jan 23 22:41:20 2015 UTC
@@ -26,7 +26,7 @@
 #include <API/IPCMessage.h>
 #include <Types.h>
 #include <Macros.h>
-#include <Config.h>
+#include <ProcessID.h>

 /** @see ProcessServer.h */
 class UserProcess;
=======================================
--- /srv/process/ProcessServer.cpp      Thu Aug 20 09:36:29 2009 UTC
+++ /srv/process/ProcessServer.cpp      Fri Jan 23 22:41:20 2015 UTC
@@ -24,7 +24,7 @@
 #include <String.h>
 #include <Error.h>
 #include <Macros.h>
-#include <Config.h>
+#include <ProcessID.h>
 #include "ProcessMessage.h"
 #include "ProcessServer.h"
 #include <stdio.h>
=======================================
--- /srv/process/SetCurrentDirectory.cpp        Sun Aug  2 12:03:39 2009 UTC
+++ /srv/process/SetCurrentDirectory.cpp        Fri Jan 23 22:41:20 2015 UTC
@@ -18,7 +18,7 @@
 #include <API/VMCopy.h>
 #include <FreeNOS/Process.h>
 #include <Error.h>
-#include <Config.h>
+#include <ProcessID.h>
 #include "FileSystemPath.h"
 #include "ProcessServer.h"
 #include "ProcessMessage.h"
=======================================
--- /srv/process/WaitProcess.cpp        Sun Aug  2 12:03:39 2009 UTC
+++ /srv/process/WaitProcess.cpp        Fri Jan 23 22:41:20 2015 UTC
@@ -18,7 +18,7 @@
 #include <API/IPCMessage.h>
 #include <FreeNOS/Process.h>
 #include <Error.h>
-#include <Config.h>
+#include <ProcessID.h>
 #include "ProcessServer.h"
 #include "ProcessMessage.h"

=======================================
--- /srv/serial/i8250.cpp       Sun Aug  2 13:41:29 2009 UTC
+++ /srv/serial/i8250.cpp       Fri Jan 23 22:41:20 2015 UTC
@@ -19,7 +19,7 @@
 #include <FreeNOS/CPU.h>
 #include <Macros.h>
 #include <Types.h>
-#include <Config.h>
+#include <ProcessID.h>
 #include "i8250.h"

 i8250::i8250(u16 b, u16 q)
=======================================
--- /srv/time/Time.cpp  Fri Aug  7 14:30:46 2009 UTC
+++ /srv/time/Time.cpp  Fri Jan 23 22:41:20 2015 UTC
@@ -19,7 +19,7 @@
 #include <FreeNOS/CPU.h>
 #include <Macros.h>
 #include <Types.h>
-#include <Config.h>
+#include <ProcessID.h>
 #include <string.h>
 #include <stdlib.h>
 #include <time.h>
=======================================
--- /srv/usb/uhci/UHCIController.cpp    Sun Aug 30 19:32:50 2009 UTC
+++ /srv/usb/uhci/UHCIController.cpp    Fri Jan 23 22:41:20 2015 UTC
@@ -18,7 +18,7 @@
 #include <API/ProcessCtl.h>
 #include <DeviceServer.h>
 #include <MemoryMessage.h>
-#include <Config.h>
+#include <ProcessID.h>
 #include "UHCIController.h"
 #include <stdio.h>
 #include <stdlib.h>

==============================================================================
Revision: 11151ba66a2c
Author:   Niek Linnenbank <nieklinnenbank@xxxxxxxxx>
Date:     Sat Jan 24 22:07:29 2015 UTC
Log:      Rewrote generation code for Config.h and HostConfig.h

https://code.google.com/p/freenos/source/detail?r=11151ba66a2c

Deleted:
 /site_scons/version.py
Modified:
 /.gitignore
 /SConstruct
 /bin/img/Main.cpp
 /include/API/SystemInfo.h
 /lib/libposix/sys/utsname/utsname.cpp
 /site_scons/build.py
 /site_scons/config.py
 /srv/terminal/Terminal.h
 /srv/video/vga/VGA.h

=======================================
--- /site_scons/version.py      Fri Jan 23 22:41:20 2015 UTC
+++ /dev/null
@@ -1,121 +0,0 @@
-#
-# Copyright (C) 2010 Niek Linnenbank
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-#
-
-import datetime
-import os
-import platform
-import re
-import SCons
-from build import *
-
-#
-# Retrieves Subversion information.
-#
-def info_receiver(path, info, pool):
-    global currentRev, url
-    currentRev = current + "-r" + str(info.rev)
-    url = str(info.URL)
-
-# Read current version.
-current      = target['VERSION']
-expr         = re.compile("\.")
-version      = expr.split(current)
-versionCode  = 0
-versionPower = 16
-url          = None
-
-# Calculate version code.
-for v in version:
-    versionCode  += int(v) * pow(2, versionPower)
-    versionPower -= 8
-
-# Include subversion revision.
-try:
-    import svn
-    import svn.client
-    import svn.core
-
-    context  = svn.client.svn_client_create_context()
-    rev      = svn.core.svn_opt_revision_t()
-    rev.king = svn.core.svn_opt_revision_head
-    path     = os.getcwd()
-    currentRev = None
-
-    svn.client.info(path, rev, rev, info_receiver, False, context)
-
-# Not a SVN repository.
-except:
-    currentRev = current + "-local"
-
-# Set the full version revision in environments.
-target['RELEASE'] = currentRev
-host['RELEASE']   = currentRev
-
-# Attempt to retrieve the correct compiler version
-try:
- compiler = os.popen(target['CC'] + " --version | head -n 1").read().strip()
-except:
-    compiler = target['CC'] + ' ' + target['CCVERSION']
-
-#
-# Converts the into to a string, and escapes double quotes.
-#
-def escape(obj):
-    return str(obj).replace('"', '\\"')
-
-
-#
-# Write all gathered data to the version.h file.
-#
-out = open("include/Version.h", "w")
-out.write('#ifndef __VERSION_H\n' \
-         '#define __VERSION_H\n' \
-         '\n' \
-         '#define VERSIONCODE ' + escape(versionCode) + '\n' \
-         '#define VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))\n' \
-         '#define RELEASE   "' + escape(currentRev) + '"\n' \
- '#define COPYRIGHT "Copyright (C) ' + escape(datetime.datetime.today().year) + ' Niek Linnenbank\\r\\n" \\\n' \ - ' "This is free software; see the source for copying conditions. There is NO\\r\\n" \\\n' \ - ' "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."\n' \
-         '\n' \
-         '#define COMPILER  "' + escape(compiler) + '"\n' \
-         '#define DATETIME  __DATE__ " " __TIME__\n' \
-         '#define ARCH      "' + escape(target['ARCH']) + '"\n' \
-         '#define SYSTEM    "' + escape(target['SYSTEM']) + '"\n' \
-         '\n' \
-         '#define BUILDUSER "' + escape(os.environ['USER']) + '"\n' \
-         '#define BUILDHOST "' + escape(platform.node()) + '"\n' \
- '#define BUILDOS "' + escape(platform.system()) + ' ' + escape(platform.release()) + '"\n' \
-         '#define BUILDARCH "' + escape(platform.machine()) + '"\n' \
- '#define BUILDPY "Python ' + escape(platform.python_version()) + '"\n' \
-         '#define BUILDER   "SCons ' + escape(SCons.__version__) + '"\n' \
-         '#define BUILDPATH "' + escape(os.getcwd()) + '"\n')
-
-# Include SVN repository, if available.
-if url is not None:
-    out.write('#define BUILDURL  "' + escape(url) + '"\n')
-else:
-    out.write('#define BUILDURL  BUILDPATH\n')
-
-# Terminate #ifndef.
-out.write('\n' \
-         '#endif\n')
-
-# Done writing.
-out.flush()
-out.close()
-
=======================================
--- /.gitignore Fri Jan 23 20:42:24 2015 UTC
+++ /.gitignore Sat Jan 24 22:07:29 2015 UTC
@@ -2,7 +2,8 @@
 *.a
 *.pyc
 build/
-include/Version.h
+/include/Config.h
+/include/HostConfig.h
 config.log
 .sconf_temp
 .sconsign.dblite
=======================================
--- /SConstruct Fri Jan 23 20:26:37 2015 UTC
+++ /SConstruct Sat Jan 24 22:07:29 2015 UTC
@@ -16,7 +16,6 @@
 #

 from build import *
-from version import *
 from archive import *
 from gdbinit import *

@@ -37,7 +36,9 @@
SConscript(target['BUILDROOT'] + '/kernel/' + target['ARCH'] + '/' + target['SYSTEM'] + '/SConscript')

 # Install files to the target RootFS
-#target.TargetInstall('VERSION')
+target.TargetInstall('VERSION')
+target.TargetInstall('build.conf', target['etc'])
+target.TargetInstall('build.host.conf', target['etc'])

 #
 # Host build
=======================================
--- /bin/img/Main.cpp   Wed Jan 21 18:25:37 2015 UTC
+++ /bin/img/Main.cpp   Sat Jan 24 22:07:29 2015 UTC
@@ -17,7 +17,7 @@

 #include <FreeNOS/BootImage.h>
 #include <FreeNOS/Memory.h>
-#include <Version.h>
+#include <Config.h>
 #include <Array.h>
 #include <ExecutableFormat.h>
 #include <stdio.h>
=======================================
--- /include/API/SystemInfo.h   Sun Jun  7 16:21:39 2009 UTC
+++ /include/API/SystemInfo.h   Sat Jan 24 22:07:29 2015 UTC
@@ -22,7 +22,7 @@
 #include <FreeNOS/Init.h>
 #include <FreeNOS/Multiboot.h>
 #include <FreeNOS/Memory.h>
-#include <Version.h>
+#include <Config.h>
 #include <Error.h>
 #include <Types.h>

=======================================
--- /lib/libposix/sys/utsname/utsname.cpp       Sun Aug  2 11:34:12 2009 UTC
+++ /lib/libposix/sys/utsname/utsname.cpp       Sat Jan 24 22:07:29 2015 UTC
@@ -15,7 +15,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */

-#include <Version.h>
+#include <Config.h>
 #include <string.h>
 #include "sys/utsname.h"

@@ -25,7 +25,7 @@
     strlcpy(name->sysname, "FreeNOS", UTSBUF);
     strlcpy(name->nodename, "localhost", UTSBUF);
     strlcpy(name->release, RELEASE, UTSBUF);
-    strlcpy(name->version, COMPILER " " DATETIME, UTSBUF);
+    strlcpy(name->version, COMPILER_VERSION " " DATETIME, UTSBUF);
     strlcpy(name->machine, ARCH, UTSBUF);

     /* Success. */
=======================================
--- /site_scons/build.py        Fri Jan 23 20:26:37 2015 UTC
+++ /site_scons/build.py        Sat Jan 24 22:07:29 2015 UTC
@@ -113,6 +113,8 @@

 # Apply configuration
 config.initialize(target, host, ARGUMENTS)
+config.write_header(target, 'include/Config.h')
+config.write_header(host, 'include/HostConfig.h')

 # Enables verbose compilation command output.
 if not target['VERBOSE']:
=======================================
--- /site_scons/config.py       Fri Jan 23 20:26:37 2015 UTC
+++ /site_scons/config.py       Sat Jan 24 22:07:29 2015 UTC
@@ -17,6 +17,8 @@

 import os.path
 import shutil
+import datetime
+import platform
 from SCons.Script import *
 from autoconf import *

@@ -60,10 +62,9 @@
            set_value(local_dict, key[5:], params[key])
     apply_file('build.host.conf', host)

-    # Apply the current VERSION to the environments.
-    version = open('VERSION').read().strip()
-    target['VERSION'] = version
-    host['VERSION'] = version
+    # Apply default variables
+    set_default_variables(target)
+    set_default_variables(host)

# Reapply commandline arguments. This overwrites anything from build*.conf
     for key in params:
@@ -72,6 +73,77 @@
        else:
            set_value(target, key, params[key])

+def escape(obj):
+    return str(obj).replace('"', '\\"')
+
+def write_header(env, filename):
+    out = open(filename, "w")
+    name, ext = os.path.splitext(filename)
+    name = name.replace('/', '_')
+
+    out.write('#ifndef __' + name.upper() + '_H\n')
+    out.write('#define __' + name.upper() + '_H\n\n')
+ out.write('#define VERSION_GET_CODE(a,b,c) (((a) << 16) + ((b) << 8) + (c))\n')
+    out.write('#define DATETIME  __DATE__ " " __TIME__\n')
+ out.write('#define COPYRIGHT "Copyright (C) ' + escape(datetime.datetime.today().year) + ' Niek Linnenbank\\r\\n" \\\n' + \ + '"This is free software; see the source for copying conditions. There is NO\\r\\n" \\\n' + \ + '"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE\\r\\n"\n')
+
+    for item in env.items():
+       if type(item[1]) is str:
+ out.write("#define " + item[0].upper() + ' "' + escape(item[1]) + '"\n')
+       elif type(item[1]) is int:
+           out.write("#define " + item[0].upper() + ' ' + str(item[1]) + '\n')
+       elif type(item[1]) is list:
+           out.write("#define " + item[0].upper() + ' "')
+           for subitem in item[1]:
+               if type(subitem) is str:
+                   out.write(escape(subitem) + ' ')
+           out.write('"\n')
+
+    out.write('#endif\n\n')
+    out.close()
+
+def set_default_variables(env):
+
+    # Read the current version from the VERSION file.
+    version = open('VERSION').read().strip()
+    env['VERSION'] = version
+
+    # Calculate a version integer code.
+    current      = env['VERSION']
+    expr         = re.compile("\.")
+    version      = expr.split(current)
+    versionCode  = 0
+    versionPower = 16
+
+    # Calculate version code.
+    for v in version:
+       versionCode  += int(v) * pow(2, versionPower)
+       versionPower -= 8
+
+    env['VERSIONCODE'] = versionCode
+
+    # Set the full version revision in environments.
+    # TODO: include the git commit/branch etc.
+    env['RELEASE'] = env['VERSION']
+
+    # Attempt to retrieve the correct compiler version
+    try:
+       compiler = os.popen(env['CC'] + " --version | head -n 1").read().strip()
+    except:
+       compiler = env['CC'] + ' ' + env['CCVERSION']
+
+    env['COMPILER_VERSION'] = compiler
+    env['BUILDUSER'] = os.environ['USER']
+    env['BUILDHOST'] = platform.node()
+    env['BUILDOS'] = platform.system() + ' ' + platform.release()
+    env['BUILDARCH'] = platform.machine()
+    env['BUILDPY'] = "Python " + platform.python_version()
+    env['BUILDER'] = "SCons " + SCons.__version__
+    env['BUILDURL'] = os.getcwd()
+    env['BUILDPATH'] = os.getcwd()
+
 def set_value(env, key, value):
     """
     Apply new value to a environment.
=======================================
--- /srv/terminal/Terminal.h    Sat Sep  5 23:08:03 2009 UTC
+++ /srv/terminal/Terminal.h    Sat Jan 24 22:07:29 2015 UTC
@@ -23,7 +23,7 @@
  * @{
  */

-#include <Version.h>
+#include <Config.h>
 #include <Device.h>
 #include <Macros.h>
 #include <Types.h>
=======================================
--- /srv/video/vga/VGA.h        Sat Sep  5 23:08:03 2009 UTC
+++ /srv/video/vga/VGA.h        Sat Jan 24 22:07:29 2015 UTC
@@ -25,7 +25,6 @@

 #include <DeviceServer.h>
 #include <Types.h>
-#include <Version.h>

 /** VGA physical video memory address. */
 #define VGA_PADDR (0xb8000)

Other related posts:

  • » [freenos] 2 new revisions pushed by nieklinn...@xxxxxxxxx on 2015-01-24 22:08 GMT - freenos