From 91b2c4ed63888acd52351b63bf5a7c6c7e501f4f Mon Sep 17 00:00:00 2001 From: Per Lundberg Date: Sat, 23 May 2015 01:25:37 +0300 Subject: [PATCH 01/31] Started working on making programs compilable again. --- Rakefile | 9 ++++---- programs/Rakefile | 23 +++++++++++++++++++++ programs/makefile | 52 ----------------------------------------------- 3 files changed, 28 insertions(+), 56 deletions(-) create mode 100644 programs/Rakefile delete mode 100644 programs/makefile diff --git a/Rakefile b/Rakefile index 0576dd6d..185b9d4e 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 @@ -68,10 +68,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/programs/Rakefile b/programs/Rakefile new file mode 100644 index 00000000..8b9fa7d9 --- /dev/null +++ b/programs/Rakefile @@ -0,0 +1,23 @@ +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 + SUBFOLDERS.each do |folder| + sh "cd #{folder} && #{RAKE_COMMAND} install" + end +end 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 From ae5274968803f9847549399566c56ec6476137cc Mon Sep 17 00:00:00 2001 From: Per Lundberg Date: Sat, 23 May 2015 01:33:37 +0300 Subject: [PATCH 02/31] Started working on making cludido compilable. --- programs/cluido/Rakefile | 15 ++++ programs/cluido/autochaos.rules | 39 ---------- programs/cluido/changelog | 85 -------------------- programs/cluido/makefile | 132 -------------------------------- programs/programs.rake | 92 ++++++++++++++++++++++ 5 files changed, 107 insertions(+), 256 deletions(-) create mode 100644 programs/cluido/Rakefile delete mode 100644 programs/cluido/autochaos.rules delete mode 100644 programs/cluido/changelog delete mode 100644 programs/cluido/makefile create mode 100644 programs/programs.rake diff --git a/programs/cluido/Rakefile b/programs/cluido/Rakefile new file mode 100644 index 00000000..b7751ccc --- /dev/null +++ b/programs/cluido/Rakefile @@ -0,0 +1,15 @@ +OBJECTS = %w( + cluido.o + command.o + init.o + list.o + nibbles.o +) + +LIBRARIES = %w( + system +) + +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 - - - - cluido.c - command.c - init.c - - - - \ 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/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/programs.rake b/programs/programs.rake new file mode 100644 index 00000000..87ccd7c1 --- /dev/null +++ b/programs/programs.rake @@ -0,0 +1,92 @@ +# 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( + -Wall + -Wextra + -Wshadow + -Wpointer-arith + -Waggregate-return + -Wredundant-decls + -Winline + -Werror + -Wcast-align + -Wsign-compare + -Wmissing-declarations + -Wmissing-noreturn + -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 + -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 + '/servers' + + sh "#{INSTALL_COMMAND} #{OUTPUT} #{target_path}/#{OUTPUT}" + sh "gzip -9 #{target_path}/#{OUTPUT}" + puts " Installed #{OUTPUT} in #{target_path}".gray +end From 057cede0719c62b5a8927a32dbba43a42a8a5091 Mon Sep 17 00:00:00 2001 From: Per Lundberg Date: Sat, 23 May 2015 20:35:37 +0300 Subject: [PATCH 03/31] Need to copy in the startup script to the disk image when running the 'install' task. --- programs/Rakefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/programs/Rakefile b/programs/Rakefile index 8b9fa7d9..2240a16d 100644 --- a/programs/Rakefile +++ b/programs/Rakefile @@ -17,6 +17,8 @@ task :clean do end task :install => :default do + sh 'mcopy startup u:/config/servers/boot' + SUBFOLDERS.each do |folder| sh "cd #{folder} && #{RAKE_COMMAND} install" end From 356202f83e99812b854c21e4d866d0b4b0641850 Mon Sep 17 00:00:00 2001 From: Per Lundberg Date: Tue, 26 May 2015 23:41:21 +0300 Subject: [PATCH 04/31] The -f flag is nice, so we overwrite files that happen to exist on the receiving side. --- servers/servers.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From a1ae565943ae62e50e6e22b78ca1e1c887d9b5a6 Mon Sep 17 00:00:00 2001 From: Per Lundberg Date: Tue, 26 May 2015 23:54:21 +0300 Subject: [PATCH 05/31] We don't need these droids any more. --- .../file_system/virtual_file_system/Rakefile | 15 ----------- .../virtual_file_system/autochaos.rules | 26 ------------------- 2 files changed, 41 deletions(-) delete mode 100644 servers/file_system/virtual_file_system/Rakefile delete mode 100644 servers/file_system/virtual_file_system/autochaos.rules diff --git a/servers/file_system/virtual_file_system/Rakefile b/servers/file_system/virtual_file_system/Rakefile deleted file mode 100644 index 8c005cbe..00000000 --- a/servers/file_system/virtual_file_system/Rakefile +++ /dev/null @@ -1,15 +0,0 @@ -OBJECTS = %w( - virtual_file_system.o -) - -LIBRARIES = %w( - ipc - memory - log - string - system -) - -OUTPUT = 'virtual_file_system' - -load '../../servers.rake' 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 - - - - virtual_file_system.c - - - - \ No newline at end of file From 61acf2a32ef0fae47d45273cac3675c7f6aa0c7f Mon Sep 17 00:00:00 2001 From: Per Lundberg Date: Wed, 27 May 2015 00:06:23 +0300 Subject: [PATCH 06/31] Trivial whitespace fix. --- servers/system/boot/boot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); From 424763aa787d0b1bb5cc0a829777969d4ccbdcf3 Mon Sep 17 00:00:00 2001 From: Per Lundberg Date: Wed, 27 May 2015 00:07:50 +0300 Subject: [PATCH 07/31] We don't need this one either. --- servers/file_system/virtual_file_system/changelog | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 servers/file_system/virtual_file_system/changelog 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. - From a6112afd4e8fd026083465d7aea170ed5315909f Mon Sep 17 00:00:00 2001 From: Per Lundberg Date: Wed, 27 May 2015 00:10:43 +0300 Subject: [PATCH 08/31] Again, removed old cruft. --- libraries/file/autochaos.rules | 27 --------------------------- libraries/file/changelog | 18 ------------------ 2 files changed, 45 deletions(-) delete mode 100644 libraries/file/autochaos.rules delete mode 100644 libraries/file/changelog 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 - .. - - - - file.c -
defines.h
-
file.h
-
functions.h
-
return_values.h
-
types.h
-
-
- - 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. - From eda2f04a0106aa72df5da4b2f7bbf1fe243a71fd Mon Sep 17 00:00:00 2001 From: Per Lundberg Date: Wed, 27 May 2015 00:15:16 +0300 Subject: [PATCH 09/31] Reversed some stupidity introduced in a1ae565943ae62e50e6e22b78ca1e1c887d9b5a6... --- servers/file_system/virtual_file_system/Rakefile | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 servers/file_system/virtual_file_system/Rakefile diff --git a/servers/file_system/virtual_file_system/Rakefile b/servers/file_system/virtual_file_system/Rakefile new file mode 100644 index 00000000..8c005cbe --- /dev/null +++ b/servers/file_system/virtual_file_system/Rakefile @@ -0,0 +1,15 @@ +OBJECTS = %w( + virtual_file_system.o +) + +LIBRARIES = %w( + ipc + memory + log + string + system +) + +OUTPUT = 'virtual_file_system' + +load '../../servers.rake' From c65b3bae5caab8f33ccbe3ef2cd7e388194d207b Mon Sep 17 00:00:00 2001 From: Per Lundberg Date: Wed, 27 May 2015 00:20:45 +0300 Subject: [PATCH 10/31] Be more informative when creating the ISO image. --- Rakefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Rakefile b/Rakefile index 89ebb81a..a0a3573d 100644 --- a/Rakefile +++ b/Rakefile @@ -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." From a17f3364df66a48c980dc220817842f7f0a88656 Mon Sep 17 00:00:00 2001 From: Per Lundberg Date: Wed, 27 May 2015 08:23:29 +0300 Subject: [PATCH 11/31] Let's add cluido to the list. --- programs/Rakefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/programs/Rakefile b/programs/Rakefile index 2240a16d..cfc085e4 100644 --- a/programs/Rakefile +++ b/programs/Rakefile @@ -1,9 +1,10 @@ Rake.application.options.rakelib = [pwd + '/../rakelib'] if Rake.application.options.rakelib.first == 'rakelib' SUBFOLDERS = %w( - cluido ) +# cluido + task :default => SUBFOLDERS do |t| t.prerequisites.each do |folder| sh "cd #{folder} && #{RAKE_COMMAND}" From e7d61f152fec2a64c8483d3c2d8b43497f38d540 Mon Sep 17 00:00:00 2001 From: Per Lundberg Date: Wed, 27 May 2015 08:23:51 +0300 Subject: [PATCH 12/31] Attempt to overwrite the startup script if it already exists. --- programs/Rakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/Rakefile b/programs/Rakefile index cfc085e4..75a6c86f 100644 --- a/programs/Rakefile +++ b/programs/Rakefile @@ -18,7 +18,7 @@ task :clean do end task :install => :default do - sh 'mcopy startup u:/config/servers/boot' + sh 'mcopy -o startup u:/config/servers/boot' SUBFOLDERS.each do |folder| sh "cd #{folder} && #{RAKE_COMMAND} install" From 63e7a26d34b399c751b5ddc395c23d252b6edcb2 Mon Sep 17 00:00:00 2001 From: Per Lundberg Date: Thu, 28 May 2015 22:25:12 +0300 Subject: [PATCH 13/31] Enabled compilation of cluido. --- programs/Rakefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/programs/Rakefile b/programs/Rakefile index 75a6c86f..bb500bac 100644 --- a/programs/Rakefile +++ b/programs/Rakefile @@ -1,10 +1,9 @@ Rake.application.options.rakelib = [pwd + '/../rakelib'] if Rake.application.options.rakelib.first == 'rakelib' SUBFOLDERS = %w( + cluido ) -# cluido - task :default => SUBFOLDERS do |t| t.prerequisites.each do |folder| sh "cd #{folder} && #{RAKE_COMMAND}" From 01c5d9d109d7cde52144c1f476e16a1e4510559d Mon Sep 17 00:00:00 2001 From: Per Lundberg Date: Fri, 29 May 2015 00:33:43 +0300 Subject: [PATCH 14/31] OCD compliance + added -Wno-pointer-sign. We should probably add the latter elsewhere also. It makes signed char and char pointers be able to be used interchangeably. --- programs/programs.rake | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/programs/programs.rake b/programs/programs.rake index 87ccd7c1..6e1a37d3 100644 --- a/programs/programs.rake +++ b/programs/programs.rake @@ -5,18 +5,19 @@ Rake.application.options.rakelib = ["#{File.dirname(__FILE__)}/../rakelib"] if R LIBRARIES_DIR = "#{File.dirname(__FILE__)}/../libraries" COMMON_CFLAGS = %w( + -Waggregate-return -Wall + -Wcast-align + -Werror -Wextra - -Wshadow - -Wpointer-arith - -Waggregate-return - -Wredundant-decls -Winline - -Werror - -Wcast-align - -Wsign-compare -Wmissing-declarations -Wmissing-noreturn + -Wno-pointer-sign + -Wpointer-arith + -Wredundant-decls + -Wshadow + -Wsign-compare -pipe -O3 -fno-builtin From d7e0dca2efe03279ce46a59c748d9bc76e2391bc Mon Sep 17 00:00:00 2001 From: Per Lundberg Date: Fri, 29 May 2015 00:39:46 +0300 Subject: [PATCH 15/31] Whee! cluido.c compiles again. --- programs/cluido/cluido.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/programs/cluido/cluido.c b/programs/cluido/cluido.c index a5ea8c69..620723f1 100644 --- a/programs/cluido/cluido.c +++ b/programs/cluido/cluido.c @@ -726,9 +726,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); From 6dfea38f19c582c43717875f1a7e7c1c8eeb99f6 Mon Sep 17 00:00:00 2001 From: Per Lundberg Date: Fri, 29 May 2015 01:04:24 +0300 Subject: [PATCH 16/31] Removed unused stuff. --- programs/cluido/command.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/programs/cluido/command.c b/programs/cluido/command.c index a115d326..37e478ac 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; } } From 04ade858538a4414730cc0478a5d5ee85776e8b0 Mon Sep 17 00:00:00 2001 From: Per Lundberg Date: Fri, 29 May 2015 21:24:44 +0300 Subject: [PATCH 17/31] Removed usage of multiline strings. Apparently, multi-line strings were a C extension that gcc *used* to support, but it was removed as of gcc 3.3. References: - lwn.net: https://lwn.net/Articles/33227/ (GCC 3.3 released) - gnu.org: https://www.gnu.org/software/gcc/gcc-3.3/changes.html (GCC 3.3 Release Series - Changes, New Features, and Fixes) --- programs/cluido/command.c | 34 +++++++++++++++--------------- programs/cluido/init.c | 44 +++++++++++++++++++-------------------- 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/programs/cluido/command.c b/programs/cluido/command.c index 37e478ac..f06d8a1a 100644 --- a/programs/cluido/command.c +++ b/programs/cluido/command.c @@ -1002,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..9c74ccd6 100644 --- a/programs/cluido/init.c +++ b/programs/cluido/init.c @@ -53,34 +53,34 @@ 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 + \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 + \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 + \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(); From a2e47f5e523564a264e27d692057c441ea8f2210 Mon Sep 17 00:00:00 2001 From: Per Lundberg Date: Fri, 29 May 2015 21:27:12 +0300 Subject: [PATCH 18/31] Dead code is bad code. The code didn't even compile. I found it now by accident, when updating the cluido app to use the Rake-based compilation pipeline. --- programs/cluido/list.c | 61 ------------------------------------------ programs/cluido/list.h | 15 ----------- 2 files changed, 76 deletions(-) delete mode 100644 programs/cluido/list.c delete mode 100644 programs/cluido/list.h 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 deleted file mode 100644 index 1bc547ff..00000000 --- a/programs/cluido/list.h +++ /dev/null @@ -1,15 +0,0 @@ -// Abstract: Linked list function prototypes and structure definitions. -// Author: Per Lundberg -// Anders Öhrt -// -// © Copyright 1999-2000 chaos development -// © Copyright 2015 chaos development - -#pragma once - -typedef struct -{ - struct list_type *previous; - struct list_type *next; - void *data; -} list_type; From 552e97fb899ac3b32802d28c094f659dc3473d2f Mon Sep 17 00:00:00 2001 From: Per Lundberg Date: Fri, 29 May 2015 21:35:56 +0300 Subject: [PATCH 19/31] This file shouldn't be listed here. --- programs/cluido/Rakefile | 1 - 1 file changed, 1 deletion(-) diff --git a/programs/cluido/Rakefile b/programs/cluido/Rakefile index b7751ccc..fde1352b 100644 --- a/programs/cluido/Rakefile +++ b/programs/cluido/Rakefile @@ -2,7 +2,6 @@ OBJECTS = %w( cluido.o command.o init.o - list.o nibbles.o ) From 79a1799ec13dac49c60cafd3276524d03911b4db Mon Sep 17 00:00:00 2001 From: Per Lundberg Date: Fri, 29 May 2015 21:39:06 +0300 Subject: [PATCH 20/31] Uncommented some #if-disabled stuff. There are still parts of this file that are very far from compiling; leaving them for the time being. --- programs/cluido/nibbles.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) 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); } } From c4d340e1c0830b119dce3ba05f4630704f5b6978 Mon Sep 17 00:00:00 2001 From: Per Lundberg Date: Fri, 29 May 2015 21:40:33 +0300 Subject: [PATCH 21/31] Weird. We need this flag to work around gcc oddness. Without it, gcc gives a warning saying that the method might be a candidate for __attribute__((noreturn)). With it, it gives instead a warning saying that the method does return (which is untrue in this case). So Incredibly Stupid... --- programs/programs.rake | 1 + 1 file changed, 1 insertion(+) diff --git a/programs/programs.rake b/programs/programs.rake index 6e1a37d3..e3e97960 100644 --- a/programs/programs.rake +++ b/programs/programs.rake @@ -9,6 +9,7 @@ COMMON_CFLAGS = %w( -Wall -Wcast-align -Werror + -Wno-error=suggest-attribute=noreturn -Wextra -Winline -Wmissing-declarations From 93a35677197a76cc0ebaec9acda7e8f1c7f3004b Mon Sep 17 00:00:00 2001 From: Per Lundberg Date: Fri, 29 May 2015 21:46:06 +0300 Subject: [PATCH 22/31] Added missing library dependencies. --- programs/cluido/Rakefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/programs/cluido/Rakefile b/programs/cluido/Rakefile index fde1352b..e03f0134 100644 --- a/programs/cluido/Rakefile +++ b/programs/cluido/Rakefile @@ -6,7 +6,13 @@ OBJECTS = %w( ) LIBRARIES = %w( + console + file + ipc + memory + string system + unicode ) OUTPUT = 'cluido' From cbe940156be113531ab57d20fd0696d6e027042b Mon Sep 17 00:00:00 2001 From: Per Lundberg Date: Sat, 30 May 2015 23:56:56 +0300 Subject: [PATCH 23/31] Removing this was a mistake. It is needed, even though list.c is probably not used. --- programs/cluido/list.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 programs/cluido/list.h diff --git a/programs/cluido/list.h b/programs/cluido/list.h new file mode 100644 index 00000000..17840c14 --- /dev/null +++ b/programs/cluido/list.h @@ -0,0 +1,15 @@ +// Abstract: Linked list function prototypes and structure definitions. +// Author: Per Lundberg +// Anders Öhrt +// +// © Copyright 1999-2000 chaos development +// © Copyright 2015 chaos development + +#pragma once + +typedef struct +{ + struct list_type *previous; + struct list_type *next; + void *data; +} list_type; From 22141de3bba7413dd13c7b75d36b68cb29feb7e0 Mon Sep 17 00:00:00 2001 From: Per Lundberg Date: Sun, 31 May 2015 00:12:58 +0300 Subject: [PATCH 24/31] Added missing library dependencies. --- programs/cluido/Rakefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/programs/cluido/Rakefile b/programs/cluido/Rakefile index e03f0134..fa6f6927 100644 --- a/programs/cluido/Rakefile +++ b/programs/cluido/Rakefile @@ -7,11 +7,16 @@ OBJECTS = %w( LIBRARIES = %w( console + execute_elf file ipc + ipv4 memory + pci + random string system + time unicode ) From cca44b52d75732343140b26d057601f9aab055cc Mon Sep 17 00:00:00 2001 From: Per Lundberg Date: Sun, 31 May 2015 00:14:05 +0300 Subject: [PATCH 25/31] Let's go with -lgcc now. We could change the kernel now also, since the issue with crosscompiling etc. isn't really relevant any more (since we use Vagrant instead, which is a much better choice). --- programs/programs.rake | 1 + 1 file changed, 1 insertion(+) diff --git a/programs/programs.rake b/programs/programs.rake index e3e97960..82f07048 100644 --- a/programs/programs.rake +++ b/programs/programs.rake @@ -40,6 +40,7 @@ CFLAGS = (COMMON_CFLAGS + %w( LDFLAGS = %W( #{LIBRARIES_DIR}/startup.o + -lgcc -nostdlib -Wl,-T,#{LIBRARIES_DIR}/chaos.ld -m32 From eddd6a2e01f3a3abf0988bfb6aa3fa240af4828e Mon Sep 17 00:00:00 2001 From: Per Lundberg Date: Sun, 31 May 2015 00:14:19 +0300 Subject: [PATCH 26/31] Updated ignore list. --- .gitignore | 1 + 1 file changed, 1 insertion(+) 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 From a54690c70147ed4ded1442868bd5ff984e8af473 Mon Sep 17 00:00:00 2001 From: Per Lundberg Date: Sun, 31 May 2015 00:32:37 +0300 Subject: [PATCH 27/31] programs should be installed under the /programs folder. Eventually, they should be copied into the ramdisk instead. --- programs/Rakefile | 3 ++- programs/programs.rake | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/programs/Rakefile b/programs/Rakefile index bb500bac..5a363501 100644 --- a/programs/Rakefile +++ b/programs/Rakefile @@ -17,7 +17,8 @@ task :clean do end task :install => :default do - sh 'mcopy -o startup u:/config/servers/boot' + # 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" diff --git a/programs/programs.rake b/programs/programs.rake index 82f07048..404db6d6 100644 --- a/programs/programs.rake +++ b/programs/programs.rake @@ -87,7 +87,7 @@ task :clean do end task :install => OUTPUT do - target_path = INSTALL_ROOT + '/servers' + target_path = INSTALL_ROOT + '/programs' sh "#{INSTALL_COMMAND} #{OUTPUT} #{target_path}/#{OUTPUT}" sh "gzip -9 #{target_path}/#{OUTPUT}" From 0d3cd69591679fc3c4db4f605b6852992af4a70a Mon Sep 17 00:00:00 2001 From: Per Lundberg Date: Sun, 31 May 2015 00:33:26 +0300 Subject: [PATCH 28/31] Added cluido to the startup list. --- menu.lst | 1 + 1 file changed, 1 insertion(+) 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 From c0933ad38cc58e3fc280698f9f05a4a49d03004c Mon Sep 17 00:00:00 2001 From: Per Lundberg Date: Sun, 31 May 2015 00:43:39 +0300 Subject: [PATCH 29/31] Removed extra whitespace that made stuff look odd. --- programs/cluido/init.c | 50 +++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/programs/cluido/init.c b/programs/cluido/init.c index 9c74ccd6..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, "\ - \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"); +\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, "\ - \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"); +\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, "\ - \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"); +\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; From 22d61fcb0d92ed0eabb058f11059e2967685e7a9 Mon Sep 17 00:00:00 2001 From: Per Lundberg Date: Sun, 31 May 2015 00:46:07 +0300 Subject: [PATCH 30/31] Force overwrite when outputting the gzip file. --- programs/programs.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/programs.rake b/programs/programs.rake index 404db6d6..8a3c62a8 100644 --- a/programs/programs.rake +++ b/programs/programs.rake @@ -90,6 +90,6 @@ task :install => OUTPUT do target_path = INSTALL_ROOT + '/programs' 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 From 4a275cb1a970a05babe951453cfedb6e0cd12156 Mon Sep 17 00:00:00 2001 From: Per Lundberg Date: Mon, 8 Jun 2015 23:29:50 +0300 Subject: [PATCH 31/31] Don't rely on values of unitialized memory. --- programs/cluido/cluido.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/programs/cluido/cluido.c b/programs/cluido/cluido.c index 620723f1..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))