This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <vfs/vfs.h> | |
| fs_node_t *fs_root = 0; | |
| uint32_t read_fs(fs_node_t *node, uint32_t offset, uint32_t size, uint8_t *buffer) | |
| { | |
| if(node->read != 0 && node->type != FS_DIRECTORY) | |
| return node->read(offset, size, buffer); | |
| else | |
| return 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <initrd/initrd.h> | |
| #include <vfs/vfs.h> | |
| #include <system.h> | |
| #include <string.h> | |
| #include <lib/krnllib.h> | |
| InitRd_Header_t *initrd_header; | |
| InitRd_File_Header_t *file_headers; | |
| fs_node_t *initrd_root; | |
| fs_node_t *initrd_dev; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #ifndef VFS_H | |
| #define VFS_H | |
| #include <stdint.h> | |
| #define FS_FILE 0x01 | |
| #define FS_DIRECTORY 0x02 | |
| #define FS_CHARDEVICE 0x03 | |
| #define FS_BLOCKDEVICE 0x04 | |
| #define FS_PIPE 0x05 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defun cddb-entry(title artist rating) | |
| (list :title title :artist artist :rating rating)) | |
| (defvar *db* nil) | |
| (defun add-record (cd) (push cd *db*)) | |
| (defun dump-db () | |
| (dolist (cd *db*) | |
| (format t "~{~a:~10t~a~%~}~%" cd ))) | |
| (defun prompt-read (prompt) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* krnllib.c for Dux */ | |
| #include <stdint.h> | |
| void puts ( char *str ) | |
| { | |
| // Call syscall 0 (printk) with str as the arg | |
| __asm__ __volatile__ (" \ | |
| mov $0, %%eax; \ | |
| mov %0, %%ebx; \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defun prompt-read (prompt) | |
| (format *query-io* "~a:" prompt) | |
| (force-output *query-io*) | |
| (read-line *query-io*)) | |
| (defun make-calc-prompt () | |
| (defparameter num1 (parse-integer (prompt-read "First number"))) | |
| (defparameter op (prompt-read "Operator (+-/*)")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defun prompt-read (prompt) | |
| (format *query-io* "~a:" prompt) | |
| (force-output *query-io*) | |
| (read-line *query-io*)) | |
| (defun make-calc-prompt () | |
| (defparameter num1 (parse-integer (prompt-read "First number"))) | |
| (defparameter op (prompt-read "Operator (+-/*)")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defun iscomposite (testnum) | |
| (setq i 2) | |
| (loop | |
| (when (= i testnum) | |
| (return-from iscomposite nil)) | |
| (if (= (mod testnum i) 0) | |
| (return-from iscomposite t)) | |
| (setq i (+ i 1)))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/ruby | |
| require 'digest/md5' | |
| require 'find' | |
| @hashfun = Digest::MD5.new | |
| @files = Hash.new() | |
| @filenames = Hash.new() | |
| @hashes = Array.[] | |
| def hashsum(filename) | |
| file = File.new(filename) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/ruby | |
| require 'digest/md5' | |
| require 'find' | |
| @hashfun = Digest::MD5.new | |
| @files = Hash.new() | |
| @filenames = Hash.new() | |
| @hashes = Array.[] | |
| def hashsum(filename) | |
| file = File.new(filename) |