diff --git a/.gitignore b/.gitignore
index 9d9d0e31..e0008ebc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,6 +11,7 @@ storm/include/storm/current-arch
storm_tests/ia32/ia32_tests
# These are painful but what do we do...
+programs/cluido/cluido
servers/block/initial_ramdisk/initial_ramdisk
servers/block/initial_ramdisk/ramdisk-auto.h
servers/block/initial_ramdisk/ramdisk.image
diff --git a/Rakefile b/Rakefile
index 3d633ac8..a0a3573d 100644
--- a/Rakefile
+++ b/Rakefile
@@ -1,7 +1,7 @@
# Top-level Rakefile which is responsible for running all the other Rakefiles.
# TODO: Uncomment the rest here as soon as we have updated their build process to rake also.
-FOLDERS = [:storm, :libraries, :servers] # :programs
+FOLDERS = [:storm, :libraries, :programs, :servers]
verbose false
@@ -39,12 +39,14 @@ end
desc 'Builds a bootable ISO image with the kernel, servers and programs.'
task :iso_image do
+
FileUtils.mkdir_p "#{INSTALL_ROOT}/boot/grub"
FileUtils.cp 'menu.lst', "#{INSTALL_ROOT}/boot/grub"
# I suspect this is actually an x86 binary, even though it resides in a folder that seems to indicate the opposite.
FileUtils.cp '/usr/lib/grub/x86_64-pc/stage2_eltorito', "#{INSTALL_ROOT}/boot/grub"
+ print 'Creating ISO image...'.cyan.bold
sh "genisoimage \
-R \
-b boot/grub/stage2_eltorito \
@@ -54,6 +56,7 @@ task :iso_image do
-input-charset ascii \
-quiet \
-o chaos.iso #{INSTALL_ROOT}"
+ puts ' done.'
end
desc "Compiles the 'storm' kernel."
@@ -75,10 +78,11 @@ task :libraries => [:storm] do |folder|
sh "cd #{folder} && #{RAKE_COMMAND}"
end
+task :programs do |folder|
+ system "cd #{folder} && rake"
+end
+
task :servers do |folder|
sh "cd #{folder} && rake"
end
-# task :programs do |folder|
-# system "cd #{folder} && rake"
-# end
diff --git a/libraries/file/autochaos.rules b/libraries/file/autochaos.rules
deleted file mode 100644
index dff11d82..00000000
--- a/libraries/file/autochaos.rules
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
-
-
-
- makefile
- ..
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/libraries/file/changelog b/libraries/file/changelog
deleted file mode 100644
index ce9ca281..00000000
--- a/libraries/file/changelog
+++ /dev/null
@@ -1,18 +0,0 @@
-2000-09-30 Per Lundberg
-
- * file.c (file_init): Changed the timeout of the
- ipc_service_resolve call, since it is no longer needed with the
- process parent unblocking.
-
-2000-07-26 Per Lundberg
-
- * file.c: Fixed an american typo.
-
-2000-07-19 Per Lundberg
-
- * file.c (file_open): Fixed some of the semantics; a program who
- wants to open a file shouldn't have to build up a data
- structure. Thus, everything needed is now passed as arguments
- instead.
- (file_read): Likewise.
-
diff --git a/menu.lst b/menu.lst
index 18a233ca..08014186 100644
--- a/menu.lst
+++ b/menu.lst
@@ -11,3 +11,4 @@ module /servers/virtual_file_system.gz
module /servers/fat.gz
module /servers/initial_ramdisk.gz
module /servers/boot.gz
+module /programs/cluido.gz
diff --git a/programs/Rakefile b/programs/Rakefile
new file mode 100644
index 00000000..5a363501
--- /dev/null
+++ b/programs/Rakefile
@@ -0,0 +1,26 @@
+Rake.application.options.rakelib = [pwd + '/../rakelib'] if Rake.application.options.rakelib.first == 'rakelib'
+
+SUBFOLDERS = %w(
+ cluido
+)
+
+task :default => SUBFOLDERS do |t|
+ t.prerequisites.each do |folder|
+ sh "cd #{folder} && #{RAKE_COMMAND}"
+ end
+end
+
+task :clean do
+ SUBFOLDERS.each do |folder|
+ sh "cd #{folder} && #{RAKE_COMMAND} clean"
+ end
+end
+
+task :install => :default do
+ # Disabled for now, since the code that generates the folder structure isn't here yet.
+ #sh 'mcopy -o startup u:/config/servers/boot'
+
+ SUBFOLDERS.each do |folder|
+ sh "cd #{folder} && #{RAKE_COMMAND} install"
+ end
+end
diff --git a/programs/cluido/Rakefile b/programs/cluido/Rakefile
new file mode 100644
index 00000000..fa6f6927
--- /dev/null
+++ b/programs/cluido/Rakefile
@@ -0,0 +1,25 @@
+OBJECTS = %w(
+ cluido.o
+ command.o
+ init.o
+ nibbles.o
+)
+
+LIBRARIES = %w(
+ console
+ execute_elf
+ file
+ ipc
+ ipv4
+ memory
+ pci
+ random
+ string
+ system
+ time
+ unicode
+)
+
+OUTPUT = 'cluido'
+
+load '../programs.rake'
diff --git a/programs/cluido/autochaos.rules b/programs/cluido/autochaos.rules
deleted file mode 100644
index 71d7dfe1..00000000
--- a/programs/cluido/autochaos.rules
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-
-
- checksum
- console
- execute_elf
- file
- ipc
- log
- math
- memory
- ipv4
- pci
- random
- string
- time
- unicode
- system
- video
- makefile
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/programs/cluido/changelog b/programs/cluido/changelog
deleted file mode 100644
index 5fb18978..00000000
--- a/programs/cluido/changelog
+++ /dev/null
@@ -1,85 +0,0 @@
-2000-09-17 Per Lundberg
-
- * command.c: New command: 'arp'.
-
-2000-09-16 Per Lundberg
-
- * command.c: New command: 'sleep'.
- (command_run): New command: 'run'.
-
-2000-09-07 Per Lundberg
-
- * command.c: New command 'time'.
-
-2000-08-24 Per Lundberg
-
- * cluido.c (string_input): Started implementing some Emacs
- compatible bindings. (mostly just for fun)
-
-2000-08-17 Henrik Hallin
-
- * cluido.c: Added some functions to simplify line edit. Also added
- support for a command history list. Fixed line editing (cursor
- moving, delete and backspace).
-
-2000-08-05 Per Lundberg
-
- * command.c (command_top): Made this command print the instruction
- pointer instead of the stack used, since I deemed it more useful
- for debugging.
- (command_font_set): New command for setting the VGA font.
-
-2000-08-04 Per Lundberg
-
- * command.c (command_irq): Added a check of the return value in
- the inner loop in this function.
-
-2000-07-25 Per Lundberg
-
- * Fixed some system_call uglyisms.
-
-2000-07-22 Per Lundberg
-
- * init.c (main): Fixed some american typos.
-
- * command.c (command_irq): New command.
- (command_port): New command.
-
-2000-07-16 Per Lundberg
-
- * Removed the 'tetris' command, since it is going to be a real,
- separate program.
-
-2000-07-07 Per Lundberg
-
- * Moved from chaos/servers to chaos/programs, since it is no
- longer really a server... (or actually, won't be for very long, so
- we'd better start making the transition)
-
-2000-06-17 Per Lundberg
-
- * command.c (command): Added an alias for ls -> dir.
-
-2000-06-12 Per Lundberg
-
- * cluido.c (environment_get): New function for reading values from
- the environment.
-
- * command.c: Sorted all command functions. Renamed the 'tasks'
- command to 'threads'. Added a command named 'kill' for killing
- threads.
-
-2000-06-04 Per Lundberg
-
- * Added support for setting up the shell environment through the
- following functions.
-
- * command.c (command_unset): New command.
- (command_show): Likewise.
- (command_set): Likewise.
-
-2000-05-01 Per Lundberg
-
- * Made cludio work again after the huge reorganizations we've been
- doing in everything lately.
-
diff --git a/programs/cluido/cluido.c b/programs/cluido/cluido.c
index a5ea8c69..bc069a2a 100644
--- a/programs/cluido/cluido.c
+++ b/programs/cluido/cluido.c
@@ -299,6 +299,8 @@ static void string_input(unsigned int max_length, bool do_syntax_check, bool com
// Allocate memory for scratchpad.
memory_allocate((void **) &string, max_length);
+ memory_set_u8((u8 *) &keyboard_packet, 0, sizeof(keyboard_packet_type));
+
while (!(keyboard_packet.key_pressed &&
keyboard_packet.has_special_key &&
keyboard_packet.special_key == IPC_KEYBOARD_SPECIAL_KEY_ENTER))
@@ -726,9 +728,8 @@ void main_loop(void)
// Before we begin, we have to know which user's config files to read.
// FIXME: This functionality should _NOT_ lie in this program.
console_print(&console_structure, "\
-I now need to know who you are, so I can read your personal configuration
- files from your home directory. Please enter your username, or just press
- enter if you don't care: ");
+I now need to know who you are, so I can read your personal configuration files from your home directory. Please enter your \
+username, or just press enter if you don't care: ");
string_input(50, FALSE, FALSE, user_name_string);
diff --git a/programs/cluido/command.c b/programs/cluido/command.c
index a115d326..f06d8a1a 100644
--- a/programs/cluido/command.c
+++ b/programs/cluido/command.c
@@ -804,7 +804,6 @@ void command_ports(int number_of_arguments, char *argument[] UNUSED)
void command_processes(int number_of_arguments UNUSED, char **argument UNUSED)
{
kernelfs_process_info_type kernelfs_process_info;
- kernelfs_thread_info_type kernelfs_thread_info;
u32 processes = KERNELFS_CLASS_PROCESS_AMOUNT;
system_call_kernelfs_entry_read(&processes);
@@ -812,16 +811,14 @@ void command_processes(int number_of_arguments UNUSED, char **argument UNUSED)
kernelfs_process_info.kernelfs_class = KERNELFS_CLASS_PROCESS_INFO;
for (kernelfs_process_info.process_number = 0;
- kernelfs_process_info.process_number < processes;
- kernelfs_process_info.process_number++)
+ kernelfs_process_info.process_number < processes;
+ kernelfs_process_info.process_number++)
{
system_call_kernelfs_entry_read(&kernelfs_process_info);
console_print_formatted(&console_structure, "%-10lu %-7u %s.\n",
kernelfs_process_info.process_id,
kernelfs_process_info.number_of_threads,
kernelfs_process_info.name);
-
- kernelfs_thread_info.process_id = kernelfs_process_info.process_id;
}
}
@@ -1005,27 +1002,27 @@ void command_shutdown(int number_of_arguments UNUSED, char **argument UNUSED)
// FIXME: Let the console server handle longer messages.
console_clear(&console_structure);
console_print(&console_structure, "\
-\e[2J\e[37;44m
-
-
-
-
-
-
-
- \e[34;47m chaos 2000 \e[37;44m");
- console_print(&console_structure, "\n
- \e[1;37mA fatal exception 0E has occured at 0028:080054f3 in VXD VMM(01) +
- \e[1;37mC0CAC01A. The current application will be terminated.
-
- ");
+ \e[2J\e[37;44m\n\
+ \n\
+ \n\
+ \n\
+ \n\
+ \n\
+ \n\
+ \n\
+ \e[34;47m chaos 2000 \e[37;44m\n");
+ console_print(&console_structure, "\
+ \n\
+ \e[1;37mA fatal exception 0E has occured at 0028:080054f3 in VXD VMM(01) +\n\
+ \e[1;37mC0CAC01A. The current application will be terminated.\n\
+ \n");
console_print(&console_structure, "\
- \e[1;37m* Press any key to terminate the current application.
- \e[1;37m* Press CTRL+ALT+DEL again to restart the computer. You will
+ \e[1;37m* Press any key to terminate the current application.\n\
+ \e[1;37m* Press CTRL+ALT+DEL again to restart the computer. You will\n\
\e[1;37m lose any unsaved information in all applications");
console_print(&console_structure, "\
-
+ \n\
\e[1;37mPress any key to continue");
while (TRUE);
}
diff --git a/programs/cluido/init.c b/programs/cluido/init.c
index bd72631e..f69cfa8c 100644
--- a/programs/cluido/init.c
+++ b/programs/cluido/init.c
@@ -53,35 +53,35 @@ int main(void)
// FIXME: This should not be put in cluido, really...
console_print(&console_structure, "\
-
- NOTE! This is an unstable prerelease of chaos. Do expect system crashes and
- strange behaviour. There is no need for you, as a user, to fix minor bugs and
- send us patches, since the bug probably already have been fixed when the patch
- arrives to us. If you find a serious bug though, please report to
- chaos-devel@lists.chaosdev.org and hopefully we can work something out. Thank
- you for your time and interest in the project.\n");
+\n\
+NOTE! This is an unstable prerelease of chaos. Do expect system crashes and\n\
+strange behaviour. There is no need for you, as a user, to fix minor bugs and\n\
+send us patches, since the bug probably already have been fixed when the patch\n\
+arrives to us. If you find a serious bug though, please report to\n\
+chaos-devel@lists.chaosdev.org and hopefully we can work something out. Thank\n\
+you for your time and interest in the project.\n");
console_print(&console_structure, "\
-
- \e[1mcluido version 0.0.1, Copyright (C) 1998-2000 chaos development.
- cluido and the rest of chaos comes with ABSOLUTELY NO WARRANTY.
- This is free software, and you are welcome to redistribute it under
- certain conditions; see the GNU GPL for details.\e[0;44m\n");
+\n\
+\e[1mcluido version 0.0.1, Copyright (C) 1998-2000 chaos development.\n\
+cluido and the rest of chaos comes with ABSOLUTELY NO WARRANTY.\n\
+This is free software, and you are welcome to redistribute it under\n\
+certain conditions; see the GNU GPL for details.\e[0;44m\n");
console_print(&console_structure, "\
-
- This is cluido, the Command Line User Interface. Type 'help' or '?' for
- information about available commands. You can also cycle through the virtual
- consoles using ALT+TAB. To 'bind' a console to a function key, use
- CTRL+ALT+Fn. This console can later be switched to by pressing ALT+Fn.
- Consoles having a blue background are shells, just like this one, and consoles
- with a black background is the log consoles (one for servers and one for the
- kernel). If tornado has been started, it will have its own graphical console
- with a movable mouse cursor.
-
- Some Emacs compatible bindings (C-a, C-e, etc) are available, and also some
- DOS:ish ones (Home, End, arrows). You can go back and forth in the command
- history with the up and down arrows.\n\n");
+\n\
+This is cluido, the Command Line User Interface. Type 'help' or '?' for\n\
+information about available commands. You can also cycle through the virtual\n\
+consoles using ALT+TAB. To 'bind' a console to a function key, use\n\
+CTRL+ALT+Fn. This console can later be switched to by pressing ALT+Fn.\n\
+Consoles having a blue background are shells, just like this one, and consoles\n\
+with a black background is the log consoles (one for servers and one for the\n\
+kernel). If tornado has been started, it will have its own graphical console\n\
+with a movable mouse cursor.\n\
+\n\
+Some Emacs compatible bindings (C-a, C-e, etc) are available, and also some\n\
+DOS:ish ones (Home, End, arrows). You can go back and forth in the command\n\
+history with the up and down arrows.\n\n");
main_loop();
return 0;
diff --git a/programs/cluido/list.c b/programs/cluido/list.c
deleted file mode 100644
index f5b89677..00000000
--- a/programs/cluido/list.c
+++ /dev/null
@@ -1,61 +0,0 @@
-// Description: Definition of data structures and functions used by the caps-build configuration file parser.
-// Author: Per Lundberg
-//
-// © Copyright 1999 chaos development
-// © Copyright 2015 chaos development
-
-#include
-#include
-#include
-
-#include "list.h"
-
-list_type *list_create(void)
-{
- list_type *new_entry;
-
- memory_allocate(sizeof(list_type), (void **) &new_entry);
-
- new_entry->next = NULL;
- new_entry->previous = NULL;
- new_entry->data = NULL;
-
- return new_entry;
-}
-
-list_type *list_insert(list_type *list, void *data)
-{
- list_type *new_entry;
-
- memory_allocate(sizeof(list_type), (void **) &new_entry);
- new_entry->next = (struct list_type *) list;
- new_entry->previous = NULL;
- list->previous = (struct list_type *) new_entry;
- new_entry->data = data;
-
- return new_entry;
-}
-
-void *list_head(list_type *list)
-{
- return list->data;
-}
-
-list_type *list_tail(list_type *list)
-{
- list_type *temp = (list_type *) list->next;
-
- return temp;
-}
-
-void list_destroy(list_type *list)
-{
- while (list != NULL)
- {
- list_type *temp_list_pointer = list;
-
- memory_deallocate(list->data);
- (list_type *) list = (list_type *) list->next;
- memory_deallocate(temp_list_pointer);
- }
-}
diff --git a/programs/cluido/list.h b/programs/cluido/list.h
index 1bc547ff..17840c14 100644
--- a/programs/cluido/list.h
+++ b/programs/cluido/list.h
@@ -1,9 +1,9 @@
// Abstract: Linked list function prototypes and structure definitions.
// Author: Per Lundberg
-// Anders Öhrt
+// Anders Öhrt
//
-// © Copyright 1999-2000 chaos development
-// © Copyright 2015 chaos development
+// © Copyright 1999-2000 chaos development
+// © Copyright 2015 chaos development
#pragma once
diff --git a/programs/cluido/makefile b/programs/cluido/makefile
deleted file mode 100644
index e27496ac..00000000
--- a/programs/cluido/makefile
+++ /dev/null
@@ -1,132 +0,0 @@
-# This makefile was generated by autochaos 0.2.1. Please do not
-# tamper with it unless you are very certain about what you are doing.
-
-ALL_ARGUMENTS = --install-prefix /tftpboot/chaos
-
-PREFIX = /tftpboot/chaos
-PACKAGE = cluido
-
-# Compiler flags.
-
-CFLAGS = -Wall -W -Wshadow -Wpointer-arith -Waggregate-return \
--Wstrict-prototypes -Wredundant-decls -Winline -Wmissing-prototypes \
--Werror -Wcast-align -Wbad-function-cast -Wsign-compare \
--Wmissing-declarations -Wmissing-noreturn -pipe \
--Wnested-externs -O3 -fno-builtin -funsigned-char -g $(EXTRA_CFLAGS) $(DEFINES)
-
-INCLUDES = \
--I. -I$(PREFIX)/data/programming/c/headers
-
-ALL_OBJECTS = \
-./cluido.o \
-./command.o \
-./init.o
-
-STATIC_LIBRARY_PATH = $(PREFIX)/data/programming/libraries/static
-
-# Ideally, this would be -lwhatever, but we have not started patching
-# the GNU tools yet...
-
-LIBS = \
-$(STATIC_LIBRARY_PATH)/library_checksum.a \
-$(STATIC_LIBRARY_PATH)/library_console.a \
-$(STATIC_LIBRARY_PATH)/library_execute_elf.a \
-$(STATIC_LIBRARY_PATH)/library_file.a \
-$(STATIC_LIBRARY_PATH)/library_ipc.a \
-$(STATIC_LIBRARY_PATH)/library_log.a \
-$(STATIC_LIBRARY_PATH)/library_math.a \
-$(STATIC_LIBRARY_PATH)/library_memory.a \
-$(STATIC_LIBRARY_PATH)/library_ipv4.a \
-$(STATIC_LIBRARY_PATH)/library_pci.a \
-$(STATIC_LIBRARY_PATH)/library_random.a \
-$(STATIC_LIBRARY_PATH)/library_string.a \
-$(STATIC_LIBRARY_PATH)/library_time.a \
-$(STATIC_LIBRARY_PATH)/library_unicode.a \
-$(STATIC_LIBRARY_PATH)/library_system.a \
-$(STATIC_LIBRARY_PATH)/library_video.a
-
-OBJECTS = \
-cluido.o \
-command.o \
-init.o
-
-
-SOURCES = \
-cluido.c \
-command.c \
-init.c
-
-HEADER_PATH = $(PREFIX)/data/programming/c/headers/$(PACKAGE)/.
-
-# TODO: Those should be overridable.
-
-CC = gcc-2.95
-NASM = nasm
-AR = ar
-RANLIB = ranlib
-GZIP = gzip -f
-
-%.o: %.c
- @echo Compiling $<...
- @$(CC) -o $(@) $(CFLAGS) $(INCLUDES) $(DEFS) -c $<
- @$(CC) -M $< $(CFLAGS) $(INCLUDES) $(DEFS) > $(*F).dep
-
-%.o: %.S
- @echo Compiling $<...
- @$(CC) -o $(@) $(CFLAGS) $(INCLUDES) $(DEFS) -c $<
- @$(CC) -M $< $(CFLAGS) $(INCLUDES) $(DEFS) > $(*F).dep
-
-%.o: %.asm
- $(NASM) -o $(@) $< -f elf
-
-.PHONY: splash all clean install package-source package-check package
-
-all: splash makefile cluido
-
-clean:
- rm -f cluido
- rm -f $(OBJECTS)
- rm -f *.dep
- -$(MAKE) clean-local
-makefile: configure
- @./configure
-
-splash:
- @echo -e "\n Compiling program: cluido...\n"
-
-configure: autochaos.rules
- @autochaos
-
-
-LDFLAGS = $(PREFIX)/data/programming/c/startup/startup.o \
--nostdlib -Wl,-T,$(PREFIX)/data/programming/linker/chaos.ld -lgcc $(EXTRA_LDFLAGS)
-
-cluido: $(OBJECTS)
- @echo "Linking..."
- @$(CC) -o $(@) $(OBJECTS) $(LIBS) $(LDFLAGS)
-
-install: all
- @echo "Installing..."
- @mkdir -p $(PREFIX)/programs/cluido
- @cp cluido $(PREFIX)/programs/cluido/cluido
- @strip -R .note -R .comment -R .eh_frame $(PREFIX)/programs/cluido/cluido
- @$(GZIP) $(PREFIX)/programs/cluido/cluido # > $(PREFIX)/programs/cluido/cluido.gz
-
-package-source:
- mkdir -p /home/per/Projects/Released/chaos-old/programs/cluido/package-source/.
- -cp -f autochaos.rules changelog configure COPYING README AUTHORS TODO INSTALL /home/per/Projects/Released/chaos-old/programs/cluido/package-source/.
- -cp -f makefile.template $(EXTRA_FILES) /home/per/Projects/Released/chaos-old/programs/cluido/package-source/.
- for source in $(SOURCES) ; do cp $$source /home/per/Projects/Released/chaos-old/programs/cluido/package-source/. || exit ; done
-package-check: package-source
- cd package-source && ./configure $(ALL_ARGUMENTS) && $(MAKE) && $(MAKE) clean
- find package-source -name makefile -exec rm {} ';'
- rm package-source/config.h
-package: package-check
- rm -rf cluido-0.1.0
- mv package-source cluido-0.1.0
- tar cvIf cluido-0.1.0.tar.bz2 cluido-0.1.0
-
--include cluido.dep
--include command.dep
--include init.dep
-
diff --git a/programs/cluido/nibbles.c b/programs/cluido/nibbles.c
index 1310f9ff..e8af920f 100644
--- a/programs/cluido/nibbles.c
+++ b/programs/cluido/nibbles.c
@@ -61,11 +61,9 @@ int playfield[PLAYFIELD_WIDTH][PLAYFIELD_HEIGHT];
void command_nibbles(void)
{
-#if FALSE
int x_pos, y_pos, player_number, segment_number;
time_type random_seed;
bool done;
- char key;
// Initialise random sequence.
system_call_timer_read(&random_seed);
@@ -101,21 +99,21 @@ void command_nibbles(void)
}
}
- console_clear();
- console_cursor_move(0, 30);
+ console_clear(&console_structure);
+ console_cursor_move(&console_structure, 0, 30);
done = FALSE;
- console_print("Starting nibbles " NIBBLES_VERSION ".\n");
+ console_print(&console_structure, "Starting nibbles " NIBBLES_VERSION ".\n");
// Let this be a single player game.
player[0].active = TRUE;
while (!done)
{
- console_clear();
+ console_clear(&console_structure);
- key = read_key();
+ read_key();
for (player_number = 0; player_number < MAX_PLAYERS; player_number++)
{
@@ -126,13 +124,12 @@ void command_nibbles(void)
}
}
- console_print("Moving players.\n");
+ console_print(&console_structure, "Moving players.\n");
move_players();
- console_print("Drawing playfield.\n");
+ console_print(&console_structure, "Drawing playfield.\n");
redraw_playfield();
}
-#endif
}
static void restart_player(int player_number)
@@ -140,7 +137,7 @@ static void restart_player(int player_number)
int counter, segment_number, x, y;
bool restarted = FALSE;
- console_print_formatted("Restarting player %d\n", player_number);
+ console_print_formatted(&console_structure, "Restarting player %d\n", player_number);
// Try to respawn at most 1000 times.
for (counter = 0; counter < 1000 && restarted == FALSE; counter++)
@@ -275,7 +272,7 @@ static void redraw_playfield(void)
row[PLAYFIELD_WIDTH] = '\n';
row[PLAYFIELD_WIDTH + 1] = '\0';
- console_print(row);
+ console_print(&console_structure, row);
}
}
diff --git a/programs/makefile b/programs/makefile
deleted file mode 100644
index a6dc5288..00000000
--- a/programs/makefile
+++ /dev/null
@@ -1,52 +0,0 @@
-## $Id$
-## Author: Per Lundberg
-
-## Copyright 1999-2000 chaos development.
-
-## 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 2 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, write to the Free Software
-## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-## USA.
-
-# List all the programs you want to compile here.
-
-PROGRAMS = cluido tetris # modplay tetris serialtest
-
-# Specify where you want make install to put the files in here. Remember to
-# do a make config afterwards!
-
-PREFIX = /tftpboot/chaos
-
-.PHONY: all autochaos clean config install tags
-
-all:
- for e in $(PROGRAMS) ; do $(MAKE) -C $$e || exit ; done
-
-clean:
- for e in $(PROGRAMS) ; do $(MAKE) -C $$e clean || exit ; done
-
-autochaos:
- for e in $(PROGRAMS) ; do cd $$e && pwd && autochaos || exit ; cd .. ; done
-
-configure:
- for e in $(PROGRAMS) ; do cd $$e && ./configure --install-prefix $(PREFIX) || exit ; cd .. ; done
-
-install:
- for e in $(PROGRAMS) ; do $(MAKE) -C $$e install || exit clean ; done
- mount /mnt/chaos-ramdisk
- install -s cluido/cluido /mnt/chaos-ramdisk/
- install startup /mnt/chaos-ramdisk/config/servers/boot
- umount /mnt/chaos-ramdisk
-
-tags:
- for e in $(PROGRAMS) ; do cd $$e ; etags *.[ch] ; cd .. ; done
diff --git a/programs/programs.rake b/programs/programs.rake
new file mode 100644
index 00000000..8a3c62a8
--- /dev/null
+++ b/programs/programs.rake
@@ -0,0 +1,95 @@
+# Common settings and Rake rules for all servers.
+
+Rake.application.options.rakelib = ["#{File.dirname(__FILE__)}/../rakelib"] if Rake.application.options.rakelib.first == 'rakelib'
+
+LIBRARIES_DIR = "#{File.dirname(__FILE__)}/../libraries"
+
+COMMON_CFLAGS = %w(
+ -Waggregate-return
+ -Wall
+ -Wcast-align
+ -Werror
+ -Wno-error=suggest-attribute=noreturn
+ -Wextra
+ -Winline
+ -Wmissing-declarations
+ -Wmissing-noreturn
+ -Wno-pointer-sign
+ -Wpointer-arith
+ -Wredundant-decls
+ -Wshadow
+ -Wsign-compare
+ -pipe
+ -O3
+ -fno-builtin
+ -funsigned-char
+ -g
+ -m32
+ -fomit-frame-pointer
+ -ffreestanding
+ )
+
+# TODO: Consider changing the rules in common_rules to presume that these are actually arrays. That requires us to modify all Rakefiles though.
+CFLAGS = (COMMON_CFLAGS + %w(
+ --std=gnu99
+ -Wbad-function-cast
+ -Wmissing-prototypes
+ -Wnested-externs
+ -Wstrict-prototypes
+)).join(' ')
+
+LDFLAGS = %W(
+ #{LIBRARIES_DIR}/startup.o
+ -lgcc
+ -nostdlib
+ -Wl,-T,#{LIBRARIES_DIR}/chaos.ld
+ -m32
+ -L#{LIBRARIES_DIR}
+)
+
+LIBRARY_FILES = LIBRARIES.map { |l| "#{LIBRARIES_DIR}/lib#{l}.a" }
+
+servers_dir = File.dirname(__FILE__)
+
+INCLUDES = %W(
+ -I#{servers_dir}/../storm/include
+ -I#{servers_dir}/../libraries
+)
+
+task :default => [ :banner, OUTPUT ] do
+ puts
+end
+
+task :banner do
+ print "Compiling ".bold
+ print OUTPUT.sub('.a', '').cyan.bold
+ puts "..."
+
+ print " "
+end
+
+file OUTPUT => OBJECTS + LIBRARY_FILES do |t|
+ begin
+ puts
+ puts " Linking binary '#{OUTPUT}'...".blue.bold
+ command = "#{CC} -o #{t.name} #{t.prerequisites.join ' '} #{LDFLAGS.join(' ')} -l#{LIBRARIES.join(' -l')}"
+ sh command
+ rescue
+ puts "Error linking #{t.source}. Full command line was: #{command}"
+ raise
+ end
+end
+
+# TODO: Check if we can get Rake's automatic 'clean' support working, so we don't have to do this manually.
+task :clean do
+ rm_f OBJECTS
+ rm_f OUTPUT
+end
+
+task :install => OUTPUT do
+ target_path = INSTALL_ROOT + '/programs'
+
+ sh "#{INSTALL_COMMAND} #{OUTPUT} #{target_path}/#{OUTPUT}"
+ sh "gzip -9f #{target_path}/#{OUTPUT}"
+ puts " Installed #{OUTPUT} in #{target_path}".gray
+end
diff --git a/servers/file_system/virtual_file_system/autochaos.rules b/servers/file_system/virtual_file_system/autochaos.rules
deleted file mode 100644
index 9913adbd..00000000
--- a/servers/file_system/virtual_file_system/autochaos.rules
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
- ipc
- log
- string
- system
- memory
- makefile
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/servers/file_system/virtual_file_system/changelog b/servers/file_system/virtual_file_system/changelog
deleted file mode 100644
index 72ef4156..00000000
--- a/servers/file_system/virtual_file_system/changelog
+++ /dev/null
@@ -1,13 +0,0 @@
-2000-07-22 Per Lundberg
-
- * virtual_file_system.c (vfs_directory_entry_read): Added support
- for reading directory listings of the kernel file system.
-
-2000-06-02 Per Lundberg
-
- * Completed a first version of vfs_directory_entry_read (). Thus,
- listing files in the VFS now mostly works.
-
- * Renamed this server from vfs to virtual_file_system. Also
- started writing this changelog.
-
diff --git a/servers/servers.rake b/servers/servers.rake
index 87ccd7c1..bb065d49 100644
--- a/servers/servers.rake
+++ b/servers/servers.rake
@@ -87,6 +87,6 @@ task :install => OUTPUT do
target_path = INSTALL_ROOT + '/servers'
sh "#{INSTALL_COMMAND} #{OUTPUT} #{target_path}/#{OUTPUT}"
- sh "gzip -9 #{target_path}/#{OUTPUT}"
+ sh "gzip -9f #{target_path}/#{OUTPUT}"
puts " Installed #{OUTPUT} in #{target_path}".gray
end
diff --git a/servers/system/boot/boot.c b/servers/system/boot/boot.c
index 75542ad2..124a9566 100644
--- a/servers/system/boot/boot.c
+++ b/servers/system/boot/boot.c
@@ -85,7 +85,7 @@ int main(void)
message_parameter.protocol = IPC_PROTOCOL_FILE;
message_parameter.message_class = IPC_FILE_MOUNT_VOLUME;
message_parameter.data = &mount;
- message_parameter.length = sizeof (file_mount_type);
+ message_parameter.length = sizeof(file_mount_type);
message_parameter.block = TRUE;
ipc_send(vfs_structure.output_mailbox_id, &message_parameter);