Skip to content

Commit

Permalink
Merge pull request #41 from chaos4ever/feature/make-cluido-work-again
Browse files Browse the repository at this point in the history
Made cluido work again
  • Loading branch information
perlun committed Jun 8, 2015
2 parents 7d1964f + 4a275cb commit a0ec190
Show file tree
Hide file tree
Showing 22 changed files with 218 additions and 524 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 8 additions & 4 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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 \
Expand All @@ -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."
Expand All @@ -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
27 changes: 0 additions & 27 deletions libraries/file/autochaos.rules

This file was deleted.

18 changes: 0 additions & 18 deletions libraries/file/changelog

This file was deleted.

1 change: 1 addition & 0 deletions menu.lst
Original file line number Diff line number Diff line change
Expand Up @@ -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
26 changes: 26 additions & 0 deletions programs/Rakefile
Original file line number Diff line number Diff line change
@@ -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
25 changes: 25 additions & 0 deletions programs/cluido/Rakefile
Original file line number Diff line number Diff line change
@@ -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'
39 changes: 0 additions & 39 deletions programs/cluido/autochaos.rules

This file was deleted.

85 changes: 0 additions & 85 deletions programs/cluido/changelog

This file was deleted.

7 changes: 4 additions & 3 deletions programs/cluido/cluido.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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);

Expand Down
41 changes: 19 additions & 22 deletions programs/cluido/command.c
Original file line number Diff line number Diff line change
Expand Up @@ -804,24 +804,21 @@ 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);
console_print(&console_structure, "PROCESS_ID THREADS NAME\n");
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;
}
}

Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit a0ec190

Please sign in to comment.