From 7021e1ad6431cf440a94e294b7cc2e0a2d1b095c Mon Sep 17 00:00:00 2001 From: StjepanBM1 Date: Tue, 9 Apr 2024 15:50:38 +0200 Subject: [PATCH] v6.0.0 --- .gitignore | 6 +- LICENSE.txt | 25 ++ Makefile | 26 +- README.txt | 60 ++-- bin/boot.sys | Bin 512 -> 0 bytes bin/kernel.sys | Bin 11305 -> 0 bytes boot/boot.mk | 2 +- boot/boot_x86.S | 221 ++++++++++++ boot/{x86.ld => boot_x86.ld} | 3 +- boot/libx86.S | 41 --- boot/x86.S | 99 ------ dirs.sh | 4 +- img/disk.img | Bin 737280 -> 0 bytes kernel/cpu/gdt.S | 25 +- kernel/cpu/ivt.S | 151 ++++++++ kernel/entry.S | 193 ++++++----- kernel/fs/bbfs/bbfs.txt | 11 - kernel/fs/bbfs/driver.S | 460 ------------------------- kernel/fs/find.S | 131 +++++++ kernel/fs/format.S | 62 ++++ kernel/fs/handler.S | 208 +++++++++++ kernel/fs/ldfs/ldfs.txt | 10 - kernel/fs/ldfs/load.S | 137 -------- kernel/fs/ldfs/status.S | 279 --------------- kernel/fs/ls.S | 80 +++++ kernel/fs/mk.S | 76 ++++ kernel/fs/rm.S | 58 ++++ kernel/kernel.ld | 22 +- kernel/kernel.mk | 9 +- kernel/libk/panic.S | 164 --------- kernel/libk/stdio.S | 169 ++++----- kernel/mp/cmd.S | 36 -- kernel/mp/cmds.S | 45 +++ kernel/mp/main.S | 415 ++++------------------ kernel/mp/parse.S | 308 +++++++++++++++++ kernel/pinb/README.txt | 16 - kernel/pinb/about.S | 155 --------- kernel/pinb/curs/about_curs.S | 128 ------- kernel/pinb/curs/desk_curs.S | 111 ------ kernel/pinb/curs/dsst_curs.S | 105 ------ kernel/pinb/curs/home_curs.S | 364 -------------------- kernel/pinb/curs/paint_curs.S | 630 ---------------------------------- kernel/pinb/dstat/dstat.S | 119 ------- kernel/pinb/home.S | 434 ----------------------- kernel/pinb/notes/notes.S | 67 ---- kernel/pinb/paint/paint.S | 523 ---------------------------- kernel/pinb/pinb.S | 55 --- kernel/pinb/prod/p_wnd.S | 157 --------- kernel/pinb/prod/words.S | 10 - kernel/pinb/sets/stng.S | 97 ------ kernel/td/README.txt | 6 + kernel/td/file.S | 54 +++ kernel/td/td.S | 585 +++++++++++++++++++++++++++++++ utils/make.bbfs | Bin 17608 -> 0 bytes utils/make.bbfs.cpp | 109 ------ utils/read.bbfs | Bin 15672 -> 0 bytes utils/read_bbfs.c | 65 ---- 57 files changed, 2334 insertions(+), 4992 deletions(-) create mode 100644 LICENSE.txt delete mode 100755 bin/boot.sys delete mode 100755 bin/kernel.sys create mode 100644 boot/boot_x86.S rename boot/{x86.ld => boot_x86.ld} (93%) delete mode 100644 boot/libx86.S delete mode 100644 boot/x86.S delete mode 100644 img/disk.img create mode 100644 kernel/cpu/ivt.S delete mode 100644 kernel/fs/bbfs/bbfs.txt delete mode 100644 kernel/fs/bbfs/driver.S create mode 100644 kernel/fs/find.S create mode 100644 kernel/fs/format.S create mode 100644 kernel/fs/handler.S delete mode 100644 kernel/fs/ldfs/ldfs.txt delete mode 100644 kernel/fs/ldfs/load.S delete mode 100644 kernel/fs/ldfs/status.S create mode 100644 kernel/fs/ls.S create mode 100644 kernel/fs/mk.S create mode 100644 kernel/fs/rm.S delete mode 100644 kernel/libk/panic.S delete mode 100644 kernel/mp/cmd.S create mode 100644 kernel/mp/cmds.S create mode 100644 kernel/mp/parse.S delete mode 100644 kernel/pinb/README.txt delete mode 100644 kernel/pinb/about.S delete mode 100644 kernel/pinb/curs/about_curs.S delete mode 100644 kernel/pinb/curs/desk_curs.S delete mode 100644 kernel/pinb/curs/dsst_curs.S delete mode 100644 kernel/pinb/curs/home_curs.S delete mode 100644 kernel/pinb/curs/paint_curs.S delete mode 100644 kernel/pinb/dstat/dstat.S delete mode 100644 kernel/pinb/home.S delete mode 100644 kernel/pinb/notes/notes.S delete mode 100644 kernel/pinb/paint/paint.S delete mode 100644 kernel/pinb/pinb.S delete mode 100644 kernel/pinb/prod/p_wnd.S delete mode 100644 kernel/pinb/prod/words.S delete mode 100644 kernel/pinb/sets/stng.S create mode 100644 kernel/td/README.txt create mode 100644 kernel/td/file.S create mode 100644 kernel/td/td.S delete mode 100755 utils/make.bbfs delete mode 100644 utils/make.bbfs.cpp delete mode 100755 utils/read.bbfs delete mode 100644 utils/read_bbfs.c diff --git a/.gitignore b/.gitignore index 9246afe..5565c29 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,6 @@ .vscode/*** -*.o \ No newline at end of file +*.s_o +*.o +*.img +*.sys +*.bin diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..9f2b419 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,25 @@ + +This is free and unencumbered software released into the public domain. + +Anyone is free to copy, modify, publish, use, compile, sell, or +distribute this software, either in source code form or as a compiled +binary, for any purpose, commercial or non-commercial, and by any +means. + +In jurisdictions that recognize copyright laws, the author or authors +of this software dedicate any and all copyright interest in the +software to the public domain. We make this dedication for the benefit +of the public at large and to the detriment of our heirs and +successors. We intend this dedication to be an overt act of +relinquishment in perpetuity of all present and future rights to this +software under copyright law. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +For more information, please refer to diff --git a/Makefile b/Makefile index 6442d1b..c929729 100644 --- a/Makefile +++ b/Makefile @@ -16,42 +16,18 @@ boot: kernel: make -f kernel/kernel.mk -# -# Double Density 3.5" 720KiB disks -# disk: dd if=/dev/zero of=$(FD_IMG) bs=512 count=1440 dd if=$(BOOT_FILE) of=$(FD_IMG) bs=512 count=1 conv=notrunc dd if=$(KERN_FILE) of=$(FD_IMG) bs=512 seek=1 conv=notrunc -# -# CD ISO - uses high density 1.44MB disk image -# -cdrom: base - dd if=/dev/zero of=$(FD_IMG) bs=512 count=2880 - dd if=$(BOOT_FILE) of=$(FD_IMG) bs=512 count=1 conv=notrunc - dd if=$(KERN_FILE) of=$(FD_IMG) bs=512 seek=1 conv=notrunc - - mkisofs -quiet -V 'os1-v550' \ - -input-charset iso8859-1 \ - -o img/disk.iso \ - -b disk.img \ - img run: - qemu-system-i386 -fda $(FD_IMG) - -run-cd: cdrom - qemu-system-i386 -cdrom $(CD_IMG) - -utils: - make -f utils/utils.mk + qemu-system-i386 -drive format=raw,file="$(FD_IMG)",index=0,if=floppy .PHONY: clean clean: make -f boot/boot.mk clean make -f kernel/kernel.mk clean - make -f utils/utils.mk clean rm $(FD_IMG) - rm $(CD_IMG) diff --git a/README.txt b/README.txt index 3f02ae9..38fafe9 100644 --- a/README.txt +++ b/README.txt @@ -4,19 +4,43 @@ -= About =- Operating System/1 or OS/1 for short is a simple 16-bit OS written in x86 assembly that runs - in Unreal mode. + in huge unreal mode. - It features a graphical environment called - Pinboard, a shell called MP-OS/1 (the real name is - quite long), and as of version 5.4.0 a functioning - file system called Bad Block File System (BBFS). + Version 6.0.0 removed some stuff, but most + importantly it added a functioning file system called + Low Performance File System (LPFS). It can handle files + up to 18KiB in size (36 512B sectors). + + Pinboard has been removed from the base + system and will be available with other software on a + special disk called "OS/1 Utilities disk". (to see the logo of OS/1 check OS-1-LOGO.png) - -= CHANGES (as of v5.5.0) =- + -= CHANGES (as of v6.0.0) =- + - BBFS: + > removed + + - LDFS: + > removed + + - LPFS: + > new FS for OS/1 + > read, write or remove files up to 18KiB + in size + > format command + + - IVT: + > custom interrupts to make developing + software for OS/1 easier + + - MP: + > more disk commands + > added cmd. line arguments + > a text editor called "td" added + - Pinboard: - > added an About tab to the top bar - > small changes to Home tab + > removed from the base OS -= System Requirements =- @@ -42,25 +66,13 @@ - an emulator (QEMU recommended) - make - When you wish to copile run this command: + When you wish to compile run this command: make -i clean && make -= Running on real hardware =- - While it is recommended that you run OS/1 - in an emulator, there have been attempts to run it - on real hardware. So far OS/1 has proven most - successful running on a COMPAQ DeskPro 386 with VGA - display and 1MB of RAM. While I have tested that it - can work with even less RAM, it is quite slow when - ran with less than 512KB of RAM. - - Also while VGA display isn't necessary I do - recommended it, since white foreground color will - start blinking on a non-VGA display. - - If you do successfully run OS/1 on a real - computer, please do send me a message so I can add - that machine to the list of PCs that have ran OS/1! + To be honest, I have no idea if this will run + on real hardware. If you have the time, do test + OS/1 6.0.0 on real hardware and tell me how it went. -= Additional =- If any bugs or issues have been found do diff --git a/bin/boot.sys b/bin/boot.sys deleted file mode 100755 index fc6ac680c62c108135eb59389fb07b765d1e1505..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 512 zcmaDYKEXd&-%!C+&s5KVfsw(<$t_qR%)p4DL+o134rYe40y~%mHUp_Gf*SHZpBv=mKgxD_q36Z%WMzZibih8TTEo zdBMc+>&qIB10`%*_|6Kv{(88JrAyZ0Mk$94LkXL^+v^WM4*xvtl%HRcnU}7or^mp{ z<&&S7l9~cy1tb<11BDfm^YcoI@^chQ@)b%lQWdgOi}F%)fQos!fQno)i?bDqQWH}Y SQj3c6ixe3~0dXM^x(Wa+%u=5K diff --git a/bin/kernel.sys b/bin/kernel.sys deleted file mode 100755 index 114d90f03ba524c0c7d8f351003ace8ee9209b13..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 11305 zcmeHN4|r77mA^CjLlOxuprVBWS49DB^AE7fj!F{39|=iH6iOFsCo?a}$Yh4jyaYn6 zj%JGDrlRg{tzb+b6Lz4sh9m+J_7NNF*49+3E%je(tG0U|)7D^7Lx7q7&V7?i(3sl& zy5G0o*G<3ryXW5DJ@=gR&b{}{dqgY`GQ!TRRpXW_LW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?R}|4@scuH~*2UMUe*D02`S~X7ws^fOuW6ZW_|)bL{!!rnH~t|bKwI1V tW0X?yCPIN9Yq^{ub>}Zwc=Z>qxwfFNXi4!>4E*2u_elSc4{Vgve*tc5zS#f( diff --git a/boot/boot.mk b/boot/boot.mk index dce4504..8aa082e 100644 --- a/boot/boot.mk +++ b/boot/boot.mk @@ -12,7 +12,7 @@ override OBJ := $(ASM:.S=.o) all: $(BIN) $(BIN): $(OBJ) - $(LD) -Tboot/x86.ld $(OBJ) -o $@ + $(LD) -Tboot/boot_x86.ld $(OBJ) -o $@ %.o: %.S $(AS) $< -o $@ diff --git a/boot/boot_x86.S b/boot/boot_x86.S new file mode 100644 index 0000000..e798e18 --- /dev/null +++ b/boot/boot_x86.S @@ -0,0 +1,221 @@ + + .code16 + .global _entry + .section .text + + _entry: + jmp _start + nop + + # + # Low Performance File System (LPFS) header + # + + _disk_volume_label: .asciz "OPERATING SYSTEM/1 SYSTEM DISK" # 31chars (+1 for '\0') + _disk_sector_size: .word 512 # Define a size of a sector in bytes + _maximal_dir_size: .word 1024 # Maximum directory size of 1024KiB (~1MB) + _minimum_dir_size: .word 1 # Minimum directory size of 1KiB + _minimal_file_size: .word 1 # Minimum file size of 1KiB (1024 bytes - 2 sectors) + _maximum_file_size: .word 18 # Maximum file size of 18KiB (16384 bytes - 2 tracks [18 sectors per track]) + _disk_id_number: .byte 79, 83, 47, 49, 20, 86, 54, 46, 48, 46, 48, 20 # 12 byte disk id nubmer + + # + # Main function of the bootloader + # + _start: + # save the boot device + movb %dl, _boot_dev + + # clear scr. + mov $0x03, %ax + int $0x10 + + # Set pallete register + mov $0x1003, %ax + mov $0x00, %bl + int $0x10 + + # Set up the font + mov $0x11, %ah + mov $0x11, %al + int $0x10 + + # Stack + cli + mov $0x9000,%ax + mov %ax, %ss + mov $0xF800,%sp + sti + + # boot message + mov $_msg_0, %si + call _print + + # + # Check for kernel file + # + # like dos' io.sys the + # kernel also needs to + # be on a specific disk + # position + # + _check_file: + mov $_msg_1,%si + call _print + + xor %ax, %ax + mov %ax, %es + + mov $0x02, %ah + mov $0x01, %al # Load 32 sectors (16KiB) of data + mov $0x0500, %bx # to address 0x0500 + mov $0x00, %ch + mov $0x02, %cl # starting from the 2nd sector + mov $0x00, %dh + movb (_boot_dev),%dl # on the boot device + int $0x13 + + xor %ax, %ax + xor %cx, %cx + + mov $0x0500, %si + mov $_file_name,%di + mov $16, %cx + + _check_loop: + movsb + loop _check_loop + + mov $0x00, %al + stosb + + mov $_file_name,%si + mov $_file, %di + call _strcmp + + jc _load_file + + mov $_err2, %si + call _print + + jmp _end + + # + # Load the kernel file to (phys. mem.) 0x0500 + # + _load_file: + mov $_msg_2,%si + call _print + + xor %ax, %ax + mov %ax, %es + + mov $0x02, %ah + mov $0x20, %al # Load 32 sectors (16KiB) of data + mov $0x0500, %bx # to address 0x0500 + mov $0x00, %ch + mov $0x02, %cl # starting from the 2nd sector + mov $0x00, %dh + movb (_boot_dev),%dl # on the boot device + int $0x13 + + jc _disk_error + + mov $_start_k, %si + call _print + + jmp 0x0500 + + # + # Clear ints. and halt + # + _end: + cli + hlt + + # + # If a int 0x13 carry flag is set jump heres + # + _disk_error: + mov $_err, %si + call _print + + xor %ax, %ax + int $0x16 + + int $0x19 + + # + # Cannot find kernel file + # + _no_kernel: + mov $_err2, %si + call _print + + xor %ax, %ax + int $0x16 + + int $0x19 + + # + # Prints out string stored in %si + # + _print: + lodsb + + or %al, %al + jz .p_done + + mov $0x0e, %ah + int $0x10 + + jmp _print + + .p_done: + ret + + # + # Compare a string in %si with a string in %di + # + _strcmp: + _str_loop: + mov (%si), %al + mov (%di), %bl + cmp %bl, %al + jne _not_equal + + cmp $0x00, %al + je _equal + + inc %di + inc %si + + jmp _str_loop + + _not_equal: + clc + ret + + _equal: + stc + ret + + # + # Variables + # + .section .rodata + + _msg_0: .asciz "\xDB\xDB\xDB OS/1\n\r" + _msg_1: .asciz "Searching for the kernel file...\n\r" + _msg_2: .asciz "Loading the kernel file...\n\r" + + _err: .asciz "Disk read error\n\rAny key to reboot" + _err2: .asciz "Cannot find the kernel file on the required locaton\r\nAny key to reboot" + + _start_k: .asciz "Starting OS/1...\r\n" + + _file: .asciz "KERNEL-6-0-0.SYS" # The file we are looking for + + .section .data16 + _boot_dev: .byte 0 + _file_name: .fill 16,1,0 # 12 char file name + 1 char for . + 3 chars for file exst. diff --git a/boot/x86.ld b/boot/boot_x86.ld similarity index 93% rename from boot/x86.ld rename to boot/boot_x86.ld index 04e9eb5..356c5f1 100644 --- a/boot/x86.ld +++ b/boot/boot_x86.ld @@ -7,7 +7,6 @@ SECTIONS .text : SUBALIGN(0) { - *(.text.main); *(.text) } @@ -31,4 +30,4 @@ SECTIONS *(.note*) } -} \ No newline at end of file +} diff --git a/boot/libx86.S b/boot/libx86.S deleted file mode 100644 index fc68996..0000000 --- a/boot/libx86.S +++ /dev/null @@ -1,41 +0,0 @@ - .code16 - .global _print - .global _strcmp - .section .text - - _print: - lodsb - - or %al, %al - jz .p_done - - mov $0x0e, %ah - int $0x10 - - jmp _print - - .p_done: - ret - - _strcmp: - _str_loop: - mov (%si), %al - mov (%di), %bl - cmp %bl, %al - jne _not_equal - - cmp $0x00, %al - je _equal - - inc %di - inc %si - - jmp _str_loop - - _not_equal: - clc - ret - - _equal: - stc - ret \ No newline at end of file diff --git a/boot/x86.S b/boot/x86.S deleted file mode 100644 index a7497f1..0000000 --- a/boot/x86.S +++ /dev/null @@ -1,99 +0,0 @@ - .code16 - .section .text - .global _entry - - .extern _printk - - /* - * Entry point (for the linker) - */ - _entry: - jmp _start # Jump over the BBFS - nop - - /* - * Bad Block File System - * Parameters - * - * as defined in BBFS specification - */ - _disk_label: .asciz "OS/1 5.5.0"# Disk label, 10 bytes - _bootable: .byte 1 # Bootable: 1-yes, 0-no - _is_wrprt: .byte 0 # Bootable: 1-yes 0-no - _file_sys: .asciz "BBFS V02" # File system str. 8 chars. - - /* - * Main bootloader function - */ - _start: - movb %dl, _bd # Save boot device num. - - mov $0x03, %ax - int $0x10 - - # Set pallete register - mov $0x1003,%ax - mov $0x00, %bl - int $0x10 - - # Set up the font - mov $0x11, %ah - mov $0x11, %al - int $0x10 - - # - # Stack setup - # - cli - mov $0x9000,%ax - mov %ax, %ss - mov $0xF800,%sp - sti - - # Print boot msg. - mov $_sm, %si - call _print - - /* - * Read kernel func. - * - * reads 64 sectors. - */ - _disk_read: - - xor %ax, %ax - mov %ax, %es - - mov $0x02, %ah - mov $0x40, %al - mov $0x7e00,%bx - mov $0x00, %ch - mov $0x02, %cl - mov $0x00, %dh - movb (_bd), %dl - - int $0x13 - - jc _disk_error - - mov $_ok, %si - call _print - - jmp 0x7e00 - - _disk_error: - mov $_er, %si - call _print - - _end: - cli - hlt - - .section .rodata - _sm: .asciz "Booting..." - _ok: .asciz "\r\nLoaded." - _pc: .asciz "\r\nPassing control to the kernel...\r\n" - _er: .asciz "\r\nDisk read error!" - - .section .data - _bd: .byte 0 diff --git a/dirs.sh b/dirs.sh index a3fcd64..4244671 100755 --- a/dirs.sh +++ b/dirs.sh @@ -1,3 +1,3 @@ -mkdir bin -mkdir img +mkdir -p bin +mkdir -p img diff --git a/img/disk.img b/img/disk.img deleted file mode 100644 index b3b555574bdfe41024372172af265adab155619f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 737280 zcmeI&4VWHPeJJqR%?C*!ya5y~6c`l+w9OY_mAfiQ2pHh=!b%kryc&&_T< z`LUZHo{;UE@$iHhJ0t8mVfzXDW*mGt```z@{F&^)GxghUE?%3>+4F%tyIQwj_(=Bd zPh}6ZKA7DeyX`xvcWV8&Z!V6_8k<_`dv7jUvx855V#=P{7vfQ>+;@edq-aF?d|D(Mdsg&6L|Z!;g%21*|YDYIFDb8 z^E%<(&({C)qs69)W997K&mKIz(sJ^$cUST~$F)>mx#y87*$2LP=144^@l5?kA1!JV zi>q3T-)OC$cvrD{V&jINIrwBHyXM{FhaVk{=Hk~PJifVjSA;X}DON=I#e0ftBV2z^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AV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs z0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZ zfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&U zAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C7 z2oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N z0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+ z009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBly zK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF z5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk z1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs z0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZ VfB*pk1PBlyK!5-N0{^K5{uR(T5rzN& diff --git a/kernel/cpu/gdt.S b/kernel/cpu/gdt.S index 66e8be3..f0a77f3 100644 --- a/kernel/cpu/gdt.S +++ b/kernel/cpu/gdt.S @@ -1,17 +1,20 @@ .code16 .global _gdt_info - .section .text.kernel + .section .text - _gdt_info: - .word gdt_end - gdt - 1 - .long gdt + _gdt_info: + .word _gdt_end - _gdt - 1 + .long _gdt - gdt: - .long 0 - .long 0 + _gdt: + .long 0 + .long 0 + + _flat_code: + .byte 0xff, 0xff, 0, 0, 0, 0b10011010, 0b10001111, 0 + + _flat_data: + .byte 0xff, 0xff, 0, 0, 0, 0b10010010, 0b11001111, 0 - flatd: - .byte 0xFF, 0xFF, 0, 0, 0, 0b10010010, 0b11001111, 0 - - gdt_end: + _gdt_end: diff --git a/kernel/cpu/ivt.S b/kernel/cpu/ivt.S new file mode 100644 index 0000000..17d6299 --- /dev/null +++ b/kernel/cpu/ivt.S @@ -0,0 +1,151 @@ + + .code16 + .global _set_ivt + .global _add_interrupt + + .section .text + + _set_ivt: + + # int. 0x30 + movb $0x30, %al + movw $_int_0x30, %si + call _add_interrupt + + # int. 0x31 + movb $0x31, %al + movw $_int_0x31, %si + call _add_interrupt + + # int. 0x32 + movb $0x32, %al + movw $_int_0x32, %si + call _add_interrupt + + # int. 0x40 + movb $0x40, %al + movw $_int_0x40, %si + call _add_interrupt + + # int. 0x41 + movb $0x41, %al + movw $_int_0x41, %si + call _add_interrupt + + ret + + # + # Add interrupt to the IVT + # + # %al - int numb. + # %si - int. handler + # + _add_interrupt: + push %ax + + xor %ax, %ax + mov %ax, %es + + pop %ax + + mov $0x04, %bl + mul %bl + mov %ax, %bx + + movw %si, %es:(%bx) + add $2, %bx + + movw %cs, %es:(%bx) + + ret + + #****************** + # + # INTERRUPTS + # + #************************* + + # + # interrupt 0x30: + # + # - no parameters + # + # - terminate program + # and return control + # to the OS + # + _int_0x30: + jmp 0x500 + iret + + # + # interrupt 0x31: + # + # %si - file name + # %dl - disk drive + # + # - create a file on a disk + # + _int_0x31: + call _mk_file + iret + + # + # interrupt 0x32: + # + # %si - file name + # %dl - disk drive + # + # - find a file from the + # disk drive + _int_0x32: + call _find_file + iret + + # + # interrupt 0x33: + # + # %si - file name + # %dl - disk drive + # + # - delete a file + # from the disk + _int_0x33: + call _rm_file + iret + + # + # interrupt 0x40: + # + # %si - string input + # + # - print str. in %si + # + _int_0x40: + call _printk + iret + + # + # interrupt 0x41: + # + # - no parameters + # + # - clear the screen + # and set it to 80x28 + # resolution + # + _int_0x41: + # clear scr. + mov $0x03, %ax + int $0x10 + + # Set pallete register + mov $0x1003, %ax + mov $0x00, %bl + int $0x10 + + # Set up the font + mov $0x11, %ah + mov $0x11, %al + int $0x10 + iret diff --git a/kernel/entry.S b/kernel/entry.S index f43bf9f..44c4fca 100644 --- a/kernel/entry.S +++ b/kernel/entry.S @@ -1,82 +1,113 @@ - .code16 - .global _entry - .section .text.kernel - - .extern _printk - - .extern _gdt_info - - .extern _bbfs_read_sector - .extern bbfs_get_params - - /* - * kernel entry point (jumps to _start) - */ - _entry: - jmp _start - nop - - /* - * main kernel function (jumped to) - */ - _start: - xor %ax, %ax - int $0x13 - - # Stack - xor %ax, %ax - mov %ax, %ds - mov %ax, %ss - mov $_start,%sp - cld - - mov $msg0, %si - call _printk - - # - # GDT & Unreal mode - # - xor %ax, %ax - mov %ax, %ds - mov %ax, %ss - mov $0x7e00,%sp - cld - - cli # clear interrupts - push %ds # save %ds - - lgdt _gdt_info # load gdt - - mov %cr0, %eax # switch to protected mode - or $1, %al # setting the protected - mov %eax, %cr0 # mode bit - - mov $0x08, %bx # select descriptor 1 - mov %bx, %ds # 0x08 = 1000B - - and $0xFe, %al # back to real mode - mov %eax, %cr0 # toggling the bit again - - pop %ds # restore %ds - sti # enable the ints. - - mov $msg1, %si - call _printk - - call _bbfs_read_sector - - call bbfs_get_params - - mov $_mp_str_title, %si - call _printk - - jmp _input - - cli - hlt - - .section .rodata.kernel - msg0: .asciz "\r\nControl passed to the kernel.\r\n" - msg1: .asciz "Switched to unreal mode.\r\n" - _mp_str_title: .asciz "\r\n\xDB Monitor Program for OS/1 (MP-OS/1) Version 1.3.0\r\n" + .code16 + .global _kernel_start + .section .text.main + + _file: .ascii "KERNEL-6-0-0.SYS" # 12 char file name and a 3 char file exst. + + _kernel_start: + # + # Stack setup + # + xor %ax, %ax + mov %ax, %ds + mov %ax, %ss + mov $0x7e00,%sp + cld + + # + # Load GDT + # + cli + push %ds + + lgdt _gdt_info + + mov %cr0, %eax + or $1, %al + mov %eax, %cr0 + + ljmp $0x08, $_prot_mode + + # + # Swith to huge unreal mode + # + _prot_mode: + mov $0x10, %bx + mov %bx, %ds + + and $0xFE, %al + mov %eax, %cr0 + + ljmp $0x00, $_unreal_mode + + _unreal_mode: + + pop %ds + sti + + # + # Load custom interrupts to IVT + # + call _set_ivt + + # + # Start the shell (located in KERNEL 6.0.0.SYS) + # + +/* + + THIS CODE ACTUALLY WORKS!!!! + + IT READS THE 16*****th SECTOR + + FOR SOME REASON QEMU USES 16 + SECTORS PER TRACK INSTEAD OF + DEFAULT 18. + + IT TOOK ME AN HOUR OF TESTING + TO FIND THAT OUT + + 1.4.2024: + NVM it now randomly + switched to using 18 + sectors per track??? + + NVM#2 the reason it + switched to using 18 + sectors per track is + because we now run + QEMU with this cmd: + qemu-system-i386 -drive format=raw,file="$(FD_IMG)",index=0,if=floppy + + xor %ax, %ax + mov %ax, %es + + mov $0x02, %ah + mov $0x40, %al # Load 32 sectors (16KiB) of data + mov $0x500, %bx # to address 0x0500 + mov $0x02, %ch # track 2 + mov $0x01, %cl # 1st sector of track 2 + mov $0x00, %dh + movb (_cur_drive),%dl + int $0x13 + + jc _disk_error + + jmp 0x500 +*/ + + jmp _mp + + cli + hlt + + _disk_error: + mov $_err, %si + call _printk + + cli + hlt + + .section .rodata + _err: .asciz "DISK ERROR!\r\n" diff --git a/kernel/fs/bbfs/bbfs.txt b/kernel/fs/bbfs/bbfs.txt deleted file mode 100644 index 96405ac..0000000 --- a/kernel/fs/bbfs/bbfs.txt +++ /dev/null @@ -1,11 +0,0 @@ - - Bad Block File System 2nd Edition -========================================= - - The second edition of BBFS is a - somewhat of a downgrade. Featuring - 512 byte blocks with 12 byte file - names. But with the 2nd edition you - can save the data (RAM storage only). - - Replaces LDFS. diff --git a/kernel/fs/bbfs/driver.S b/kernel/fs/bbfs/driver.S deleted file mode 100644 index 27fbf0e..0000000 --- a/kernel/fs/bbfs/driver.S +++ /dev/null @@ -1,460 +0,0 @@ - - .code16 - .section .text.filesys - - .global _bbfs_read_sector - .global bbfs_get_params - .global _bbfs_print_info - - .global _bbfs_write_to_ram_block - .global _bbfs_read_ram_block - - .global _bbfs_ram_exec - - # - # BBFS read sector - # - _bbfs_read_sector: - - push %ax - push %bx - push %cx - push %dx - push %es - - xor %ax, %ax - mov %ax, %es - - mov $0x02, %ah - mov $0x01, %al - mov $0xAA00,%bx - mov $0x00, %ch - mov $0x01, %cl - mov $0x00, %dh - mov $0x00, %dl - - int $0x13 - - jc _fail_read - - mov $_disk_ok, %si - call _printk - - pop %es - pop %dx - pop %cx - pop %bx - pop %ax - - ret - - # - # BBFS get disk parameters - # - bbfs_get_params: - push %ax - push %bx - push %cx - push %dx - push %es - - _get_label: - xor %ax, %ax - mov $0xAA03,%si # Src - mov $_disk_label, %di # Dest - mov $10, %cx # Num of chars to cpy. - - _copy_label_l: - movsb # Copy the src to dest - loop _copy_label_l # Loop until \0 - - mov $_msg_label, %si - call _printk - mov $_disk_label, %si - call _printk - - _bl_size: - xor %ax, %ax - mov $0xAA0E,%si - mov $_bootable,%di - mov $1, %cx - - _copy_bl_l: - movsb - loop _copy_bl_l - - mov $_msg_boot,%si - call _printk - mov $_bootable, %si - call _printk - - _fs_id: - xor %ax, %ax - mov $0xAA10,%si - mov $_file_sys,%di - mov $8, %cx - - _copy_fs_id_l: - movsb - loop _copy_fs_id_l - - mov $_msg_fs_id,%si - call _printk - mov $_file_sys, %si - call _printk - - pop %es - pop %dx - pop %cx - pop %bx - pop %ax - - ret - - # - # Output disk info - # - _bbfs_print_info: - mov $_disk_ok, %si - call _printk - - mov $_msg_label, %si - call _printk - mov $_disk_label, %si - call _printk - - mov $_msg_boot,%si - call _printk - mov $_bootable, %si - call _printk - - mov $_msg_fs_id,%si - call _printk - mov $_file_sys, %si - call _printk - - mov $0x0e, %ah - mov $'\r', %al - int $0x10 - - mov $'\n', %al - int $0x10 - - ret - - # - # Write data to RAM block. - # - # %ax - what block (1-5) - # %si - data to copy - # %cx - num. of bytes to copy - # - _bbfs_write_to_ram_block: - cmp $512, %cx - jg .f_to_big_data - - cmp $0x01, %ax - je .block_1 - - cmp $0x02, %ax - je .block_2 - - cmp $0x03, %ax - je .block_3 - - cmp $0x04, %ax - je .block_4 - - cmp $0x05, %ax - je .block_5 - - jmp .f_no_ram_blck - - .block_1: - xor %ax, %ax - mov $0xAC00, %di - - _b1_loop: - movsb - loop _b1_loop - - mov $0x00, %al - stosb - - mov $_b1_w_done,%si - call _printk - - jmp .done - - .block_2: - xor %ax, %ax - mov $0xAE00, %di - - _b2_loop: - movsb - loop _b2_loop - - mov $0x00, %al - stosb - - mov $_b2_w_done,%si - call _printk - - jmp .done - - .block_3: - xor %ax, %ax - mov $0xB000, %di - - _b3_loop: - movsb - loop _b3_loop - - mov $0x00, %al - stosb - - mov $_b3_w_done, %si - call _printk - - jmp .done - - .block_4: - xor %ax, %ax - mov $0xB200, %di - - _b4_loop: - movsb - loop _b4_loop - - mov $0x00, %al - stosb - - mov $_b4_w_done,%si - call _printk - - jmp .done - - .block_5: - xor %ax, %ax - mov $0xB400, %di - - _b5_loop: - movsb - loop _b5_loop - - mov $0x00, %al - stosb - - mov $_b5_w_done,%si - call _printk - - jmp .done - - .f_no_ram_blck: - mov $_ram_err1, %si - call _printk - - jmp .done - - .f_to_big_data: - mov $_ram_err2, %si - call _printk - - jmp .done - - .done: - ret - - # - # Read data from RAM block and - # copy it to 0xAA00 - # - # %ax - what block (1-5) - # %cx - num. of bytes to read - # - _bbfs_read_ram_block: - cmp $512, %cx - jg .r_too_data - - cmp $0x01, %ax - je .ram_block_1 - - cmp $0x02, %ax - je .ram_block_2 - - cmp $0x03, %ax - je .ram_block_3 - - cmp $0x04, %ax - je .ram_block_4 - - cmp $0x05, %ax - je .ram_block_5 - - jmp .r_no_block - - .ram_block_1: - xor %ax, %ax - mov $0xAA00, %di - mov $0xAC00, %si - - .rb_1_loop: - movsb - loop .rb_1_loop - - mov $0x00, %al - stosb - - mov $_b1_r_done,%si - call _printk - - jmp .r_done - - .ram_block_2: - xor %ax, %ax - mov $0xAA00, %di - mov $0xAE00, %si - - .rb_2_loop: - movsb - loop .rb_2_loop - - mov $0x00, %al - stosb - - mov $_b2_r_done,%si - call _printk - - jmp .r_done - - .ram_block_3: - xor %ax, %ax - mov $0xAA00, %di - mov $0xB000, %si - - .rb_3_loop: - movsb - loop .rb_3_loop - - mov $0x00, %al - stosb - - mov $_b3_r_done,%si - call _printk - - jmp .r_done - - .ram_block_4: - xor %ax, %ax - mov $0xAA00, %di - mov $0xB200, %si - - .rb_4_loop: - movsb - loop .rb_4_loop - - mov $0x00, %al - stosb - - mov $_b4_r_done,%si - call _printk - - jmp .r_done - - .ram_block_5: - xor %ax, %ax - mov $0xAA00, %di - mov $0xB400, %si - - .rb_5_loop: - movsb - loop .rb_5_loop - - mov $0x00, %al - stosb - - mov $_b5_r_done,%si - call _printk - - jmp .r_done - - .r_no_block: - mov $_ram_err1, %si - call _printk - - jmp .done - - .r_too_data: - mov $_ram_err2, %si - call _printk - - jmp .r_done - - .r_done: - ret - - # - # Jump to 0xAA00 - # - _bbfs_ram_exec: - mov $_ram_run, %si - call _printk - - jmp 0xAA00 - - # - # BBFS failure function - # - _fail_read: - mov $_disk_error, %si - call _printk - - xor %ax, %ax - int $0x16 - - jmp $0xFFFFF,$0 - - cli - hlt - - .section .rodata.filesys - _b1_w_done: .asciz "\tFinished writing data to RAM block #1 @ 0xAC00\r\n" - _b2_w_done: .asciz "\tFinished writing data to RAM block #2 @ 0xAE00\r\n" - _b3_w_done: .asciz "\tFinished writing data to RAM block #3 @ 0xB000\r\n" - _b4_w_done: .asciz "\tFinished writing data to RAM block #4 @ 0xB200\r\n" - _b5_w_done: .asciz "\tFinished writing data to RAM block #5 @ 0xB400\r\n" - - _b1_r_done: .asciz "\tFinished reading RAM block #1 (copied @ 0xAA00)\r\n" - _b2_r_done: .asciz "\tFinished reading RAM block #2 (copied @ 0xAA00)\r\n" - _b3_r_done: .asciz "\tFinished reading RAM block #3 (copied @ 0xAA00)\r\n" - _b4_r_done: .asciz "\tFinished reading RAM block #4 (copied @ 0xAA00)\r\n" - _b5_r_done: .asciz "\tFinished reading RAM block #5 (copied @ 0xAA00)\r\n" - - _ram_run: .asciz "\tJumping to 0xAA00\r\n" - - _ram_err1: .asciz "\tWrong RAM block specified.\r\n" - _ram_err2: .asciz "\tData size limit exceeded. Maximum of 512 bytes.\r\n" - - _ram_error: .asciz "\tFailed to write data to the RAM block.\r\n" - - - _disk_error: .ascii "BBFS: Disk error.\r\n" - .asciz "Boot ended in a failure. Any key to retry." - - _disk_ok: .asciz "BBFS parameter: \r\n" - - _msg_label: .asciz "\t\tDISK LABEL: " - _msg_boot: .asciz "\r\n\t\tBOOTABLE: " - _msg_wrprt: .asciz "\r\n\t\tWRITE PR.: " - _msg_fs_id: .asciz "\r\n\t\tFILE SYS: " - - _msg_cp_w_done: .asciz "Disk copying done.\r\n" - - .section .data.filesys - .global _block_size - .global _disk_label - .global _file_sys - _ram_out: .fill 512, 1, 0 - _disk_label: .asciz " " - _bootable: .asciz " " - _file_sys: .asciz " " diff --git a/kernel/fs/find.S b/kernel/fs/find.S new file mode 100644 index 0000000..f4b7ae7 --- /dev/null +++ b/kernel/fs/find.S @@ -0,0 +1,131 @@ + + .code16 + .global _find_file + .global _find_empty + .section .text + + # + # %si - file name + # %dl - disk drive + # + # returns: + # %ch - starting file track + # + _find_file: + + # + # save the input to $_filename + # + _save_filename: + xor %ax, %ax + mov $_filename,%di + mov $16, %cx + + _save_fn_l: + movsb + loop _save_fn_l + + mov $0x00, %al + stosb + + # + # search the file + # + # we don't check for + # the first 17KiB + # since that space is + # reserved for the kernel + # file + # + xor %cx, %cx + mov $0x02, %ch + _search_loop: + xor %ax, %ax + mov %ax, %es + + mov $0x02, %ah + mov $0x01, %al # Load 32 sectors (16KiB) of data + mov $0x5000, %bx # to address 0x0500 + mov $0x01, %cl # starting from the 2nd sector + mov $0x00, %dh + movb (_cur_drive),%dl + int $0x13 + + push %cx + + mov $0x5000,%si + mov $_tmp_file,%di + mov $16, %cx + + _copy_l: + movsb + loop _copy_l + + mov $0x00, %al + stosb + + pop %cx + + mov $_filename,%si + mov $_tmp_file,%di + call _strcmp + jc _found + + add $0x02, %ch + + cmp $0x50, %ch + jg _not_found + + jmp _search_loop + + + _found: + stc + ret + + _not_found: + clc + ret + + # + # Find empty space + # + # if found set carry flag + # + _find_empty: + xor %cx, %cx + mov $0x02, %ch + + _fe_loop: + xor %ax, %ax + mov %ax, %es + + mov $0x02, %ah + mov $0x01, %al # Load 32 sectors (16KiB) of data + mov $0x5000, %bx # to address 0x0500 + mov $0x01, %cl # starting from the 2nd sector + mov $0x00, %dh + movb (_cur_drive),%dl + int $0x13 + + cmpb $0x00, 0x5000 + je _fe_found + + add $0x02, %ch + + cmp $0x50, %ch + jg _fe_not_found + + jmp _fe_loop + + _fe_found: + stc + ret + + _fe_not_found: + clc + ret + + .section .rodata + _filename: .fill 17,1,0 + _tmp_file: .fill 17,1,0 diff --git a/kernel/fs/format.S b/kernel/fs/format.S new file mode 100644 index 0000000..c1dc15d --- /dev/null +++ b/kernel/fs/format.S @@ -0,0 +1,62 @@ + + .code16 + .global _format_disk + .section .text + + # + # %si - disk label + # %dl - disk drive + # + _format_disk: + # + # Save the label + # + mov $_label,%di + mov $30, %cx + rep movsb + + xor %cx, %cx + mov $0x02, %ch + _format_loop: + xor %ax, %ax + mov %ax, %es + + mov $0x03, %ah + mov $0x01, %al + mov $0x5000, %bx + mov $0x01, %cl + mov $0x00, %dh + movb (_cur_drive),%dl + int $0x13 + + add $0x02, %ch + + cmp $0x50, %ch + jg _format_label + + jmp _format_loop + + _format_label: + mov $_label,%si + mov $0xC003,%di + mov $31, %cx + rep movsb + + xor %ax, %ax + mov %ax, %es + + mov $0x03, %ah + mov $0x01, %al + mov $0x5000, %bx + mov $0x00, %ch + mov $0x01, %cl + mov $0x00, %dh + movb (_cur_drive),%dl + int $0x13 + + _format_done: + ret + + .section .rodata + _label: .fill 30,1,20 + .byte 0 diff --git a/kernel/fs/handler.S b/kernel/fs/handler.S new file mode 100644 index 0000000..d8935be --- /dev/null +++ b/kernel/fs/handler.S @@ -0,0 +1,208 @@ + + .code16 + .global _handle_file + .section .text + + # + # _handle_file: + # + # %si - file name (with exst.) + # + # - decides what to do based + # on the file exstension + # + _handle_file: + mov $_file_tmp, %di + mov $16, %cx + rep movsb + + mov $0x00, %al + stosb + + mov $_file_tmp, %si + + _skip_to_exst: + movb (%si), %al + + cmp $0x00, %al + je _handler_end + + cmp $0x2E, %al + je _get_exst + + inc %si + inc %di + + jmp _skip_to_exst + + _get_exst: + inc %si + mov %si, %bx + mov $_file_exst,%di + + _exst_loop: + movb (%si), %al + + cmp $0x00, %al + je _check_exst + + movb %al, (%di) + + inc %si + inc %di + + jmp _exst_loop + + _check_exst: + mov $_file_exst,%si + mov $_cmd_exst,%di + call _strcmp + jc _command_file + + mov $_file_exst,%si + mov $_exe_exst,%di + call _strcmp + jc _executable + + mov $_file_exst,%si + mov $_sys_exst,%di + call _strcmp + jc _system_file + + jmp _handler_end + + _command_file: + mov $_com_msg, %si + call _printk + + mov $_file_tmp, %si + movb (_cur_drive),%dl + call _find_file + + # run the command file + # (0x2000) + xor %ax, %ax + mov %ax, %ds + + mov $0x02, %ah + mov $0x12, %al + mov $0x2000,%bx + mov $0x01, %cl + mov $0x00, %dh + movb (_cur_drive),%dl + int $0x13 + + mov $0x02, %ah + mov $0x12, %al + mov $0x4400,%bx + inc %ch + mov $0x01, %cl + mov $0x00, %dh + movb (_cur_drive),%dl + int $0x13 + + jmp 0x2000 + + ret + + _executable: + mov $_exe_msg, %si + call _printk + + mov $_file_tmp, %si + movb (_cur_drive),%dl + call _find_file + + # execute the file + # (0x2000) + mov $_file_tmp, %si + movb (_cur_drive),%dl + call _find_file + + xor %ax, %ax + mov %ax, %ds + + mov $0x02, %ah + mov $0x12, %al + mov $0x2000,%bx + mov $0x01, %cl + mov $0x00, %dh + movb (_cur_drive),%dl + int $0x13 + + mov $0x02, %ah + mov $0x12, %al + mov $0x4400,%bx + inc %ch + mov $0x01, %cl + mov $0x00, %dh + movb (_cur_drive),%dl + int $0x13 + + jmp 0x2000 + + ret + + _system_file: + mov $_file_tmp, %si + movb (_cur_drive),%dl + call _find_file + + # pass the control + # to the system file + # (0x2000) + + /* + This could lead + to many cases of + malware taking the + control of the system + */ + + xor %ax, %ax + mov %ax, %ds + + mov $0x02, %ah + mov $0x12, %al + mov $0x2000,%bx + mov $0x01, %cl + mov $0x00, %dh + movb (_cur_drive),%dl + int $0x13 + + mov $0x02, %ah + mov $0x12, %al + mov $0x4400,%bx + inc %ch + mov $0x01, %cl + mov $0x00, %dh + movb (_cur_drive),%dl + int $0x13 + + jmp 0x2000 + + ret + + _handler_end: + mov $_unknow, %si + call _printk + + ret + + .section .rodata + # msgs + _com_msg: .asciz "COMMAND FILE!!\r\n" + _exe_msg: .asciz "EXECUTEABLE FILE!!\r\n" + _sys_msg: .asciz "SYSTEM FILE!!\r\n" + + _unknow: .asciz "Unknow file type. Not sure what to do with it.\r\n" + + # file exstensions + _cmd_exst: .asciz "CMD" + _exe_exst: .asciz "EXE" + _sys_exst: .asciz "SYS" + + .section .data + _file_tmp: .fill 17,1,0 + _file_start: .byte 0 + _file_exst: .fill 4,1,0 diff --git a/kernel/fs/ldfs/ldfs.txt b/kernel/fs/ldfs/ldfs.txt deleted file mode 100644 index 4a261e5..0000000 --- a/kernel/fs/ldfs/ldfs.txt +++ /dev/null @@ -1,10 +0,0 @@ - Legacy Disk File System -=============================== - - Legacy Disk File System or LDFS was - a short lived file system used in OS/1 - before BBFS. It doesn't recognize files - instead it just jumps to 0x0000:0x7e00 - of a disk in the drive A/B. - - Only here for backward compatibility diff --git a/kernel/fs/ldfs/load.S b/kernel/fs/ldfs/load.S deleted file mode 100644 index d6ea0ef..0000000 --- a/kernel/fs/ldfs/load.S +++ /dev/null @@ -1,137 +0,0 @@ - - .code16 - .global _load_A - .global _load_B - .section .text.filesys - - # - # _load_B: Load the data from the disk drive A. - # And jump to the 0x7e00 address of the disk. - _load_A: - clc - incb (tries) - - mov $0x02, %ah - mov $0x40, %al - mov $0x7e00,%bx - mov $0x00, %ch - mov $0x02, %cl - mov $0x00, %dh - mov $0x00, %dl - int $0x13 - - jc _err_A - - ljmp $0x0000,$0x7e00 - - # - # _load_B: Load the data from the disk drive B. - # And jump to the 0x7e00 address of the disk. - _load_B: - clc - incb (tries) - - mov $0x02, %ah - mov $0x40, %al - mov $0x7e00,%bx - mov $0x00, %ch - mov $0x02, %cl - mov $0x00, %dh - mov $0x01, %dl - int $0x13 - - jc _err_B - - ljmp $0x0000,$0x7e00 - - # - # _err_A: Disk load error for _load_A function - _err_A: - clc - cmpb $3, (tries) - jl _load_A - - mov $0x03, %ax - int $0x10 - - xor %ax, %ax - int $0x13 - - mov $0x13, %ah - mov $0x01, %al - mov $0x00, %bh - mov $0x0c, %bl - mov $0x2e, %cx - mov $0x00, %dh - mov $0x00, %dl - mov $_ler_A,%bp - int $0x10 - - call _disk_status - - mov $0x13, %ah - mov $0x01, %al - mov $0x00, %bh - mov $0x0f, %bl - mov $0x21, %cx - mov $0x01, %dh - mov $0x00, %dl - mov $_retmg,%bp - int $0x10 - - mov $0x00, %ax - int $0x16 - - call _clear - - jmp $0xFFFFF, $0 - - # - # _err_B: Disk load error for _load_B function - _err_B: - clc - cmpb $3, (tries) - jl _load_B - - mov $0x03, %ax - int $0x10 - - xor %ax, %ax - int $0x13 - - mov $0x13, %ah - mov $0x01, %al - mov $0x00, %bh - mov $0x0c, %bl - mov $0x2e, %cx - mov $0x00, %dh - mov $0x00, %dl - mov $_ler_B,%bp - int $0x10 - - call _disk_status - - mov $0x13, %ah - mov $0x01, %al - mov $0x00, %bh - mov $0x0f, %bl - mov $0x21, %cx - mov $0x01, %dh - mov $0x00, %dl - mov $_retmg,%bp - int $0x10 - - mov $0x00, %ax - int $0x16 - - call _clear - - jmp $0xFFFFF, $0 - - .section .rodata - _ler_A: .asciz "/!\\ Failed to load the data from drive A /!\\\r\n" - _ler_B: .asciz "/!\\ Failed to load the data from drive B /!\\\r\n" - _retmg: .asciz "\r\nPress any key to return to OS/1" - - .section .data - tries: .byte 0 diff --git a/kernel/fs/ldfs/status.S b/kernel/fs/ldfs/status.S deleted file mode 100644 index aaea6ef..0000000 --- a/kernel/fs/ldfs/status.S +++ /dev/null @@ -1,279 +0,0 @@ - - /* - Status messages taken from: - https://stanislavs.org/helppc/int_s_03-1.html - */ - - .code16 - .section .text.filesys - .global _disk_status - - # - # Check for disk drive errors - # - _disk_status: - mov $0x01, %ah - int $0x13 - - movb %al, (_ec) - - mov $_s_XX, %si - call _printk - - xor %ax, %ax - - movb (_ec), %al - - # - # There is probably a macro that could some all of my issues here - # but I'm to lazy to play around with GAS macros. So here it is: - # the CMP monster. - # - # TODO: Use macros! - # - - cmp $0x00, %al - je _00 - - cmp $0x01, %al - je _01 - - cmp $0x02, %al - je _02 - - cmp $0x03, %al - je _03 - - cmp $0x04, %al - je _04 - - cmp $0x05, %al - je _05 - - cmp $0x06, %al - je _06 - - cmp $0x07, %al - je _07 - - cmp $0x08, %al - je _08 - - cmp $0x09, %al - je _09 - - cmp $0x0A, %al - je _0A - - cmp $0x0B, %al - je _0B - - cmp $0x0C, %al - je _0C - - cmp $0x0D, %al - je _0D - - cmp $0x0E, %al - je _0E - - cmp $0x0F, %al - je _0F - - cmp $0x10, %al - je _10 - - cmp $0x11, %al - je _11 - - cmp $0x20, %al - je _20 - - cmp $0x40, %al - je _40 - - cmp $0x80, %al - je _80 - - cmp $0xAA, %al - je _AA - - cmp $0xBB, %al - je _BB - - cmp $0xCC, %al - je _CC - - cmp $0xE0, %al - je _E0 - - cmp $0xFF, %al - je _FF - - ret - - _00: - mov $_s_00, %si - call _printk - ret - - _01: - mov $_s_01, %si - call _printk - ret - - _02: - mov $_s_02, %si - call _printk - ret - - _03: - mov $_s_03, %si - call _printk - ret - - _04: - mov $_s_04, %si - call _printk - ret - - _05: - mov $_s_05, %si - call _printk - ret - - _06: - mov $_s_06, %si - call _printk - ret - - _07: - mov $_s_07, %si - call _printk - ret - - _08: - mov $_s_08, %si - call _printk - ret - - _09: - mov $_s_09, %si - call _printk - ret - - _0A: - mov $_s_0A, %si - call _printk - ret - - _0B: - mov $_s_0B, %si - call _printk - ret - - _0C: - mov $_s_0C, %si - call _printk - ret - - _0D: - mov $_s_0D, %si - call _printk - ret - - _0E: - mov $_s_0E, %si - call _printk - ret - - _0F: - mov $_s_0F, %si - call _printk - ret - - _10: - mov $_s_10, %si - call _printk - ret - - _11: - mov $_s_11, %si - call _printk - ret - - _20: - mov $_s_20, %si - call _printk - ret - - _40: - mov $_s_40, %si - call _printk - ret - - _80: - mov $_s_80, %si - call _printk - ret - - _AA: - mov $_s_AA, %si - call _printk - ret - - _BB: - mov $_s_BB, %si - call _printk - ret - - _CC: - mov $_s_CC, %si - call _printk - ret - - _E0: - mov $_s_E0, %si - call _printk - ret - - _FF: - mov $_s_FF, %si - call _printk - ret - - _ec: .byte 0 - - .section .rodata - _s_XX: .asciz " Disk status:" - - # - # A lot of strings! - # - - _s_00: .asciz " No disk drive error\r\n" - _s_01: .asciz " Bad command passed to the disk driver\r\n" - _s_02: .asciz " Address mark not found / Bad sector\r\n" - _s_03: .asciz " Diskette write protect error\r\n" - _s_04: .asciz " Sector not found\r\n" - _s_05: .asciz " Fixed disk reset failed\r\n" - _s_06: .asciz " Diskette changed or removed\r\n" - _s_07: .asciz " Bad fixed disk parameter table\r\n" - _s_08: .asciz " DMA overrun\r\n" - _s_09: .asciz " DMA access across 64K boundry\r\n" - _s_0A: .asciz " Bad fixed disk sector flag\r\n" - _s_0B: .asciz " Bad fixed disk cylinder\r\n" - _s_0C: .asciz " Unsupported track/invalid media\r\n" - _s_0D: .asciz " Invalid number of sectors on a fixed disk format\r\n" - _s_0E: .asciz " Fixed disk controlled data address mark detected\r\n" - _s_0F: .asciz " Fixed disk DMA arbitration level out of range\r\n" - _s_10: .asciz " ECC/CRC error on disk read\r\n" - _s_11: .asciz " Recoverable fixed disk data error, data fixed by ECC\r\n" - _s_20: .asciz " Controller error (NEC for diskettes)\r\n" - _s_40: .asciz " Seek failure\r\n" - _s_80: .asciz " Time out, drive not ready\r\n" - _s_AA: .asciz " Fixed disk, drive not ready\r\n" - _s_BB: .asciz " Fixed disk undefined error\r\n" - _s_CC: .asciz " Fixed disk write fault on selected drive\r\n" - _s_E0: .asciz " Fixed disk status error / Error reg = 0\r\n" - _s_FF: .asciz " Sense operation failed\r\n" diff --git a/kernel/fs/ls.S b/kernel/fs/ls.S new file mode 100644 index 0000000..d581685 --- /dev/null +++ b/kernel/fs/ls.S @@ -0,0 +1,80 @@ + + .code16 + .global _ls_dir + .section .text + + _ls_dir: + xor %cx, %cx + mov $0x02, %ch + + _ls_loop: + xor %ax, %ax + mov %ax, %es + + mov $0x02, %ah + mov $0x01, %al + mov $0x5000, %bx + mov $0x01, %cl + mov $0x00, %dh + movb (_cur_drive),%dl + int $0x13 + + push %cx + + mov $0x5000,%si + mov $_ls_file,%di + mov $16, %cx + rep movsb + + mov $0x0d, %al + stosb + mov $0x0a, %al + stosb + mov $0x00, %al + stosb + + pop %cx + + mov $_ls_file, %si + call _printk + + add $0x02, %ch + + cmp $0x50, %ch + jg _ls_dstat + + jmp _ls_loop + + _ls_dstat: + xor %ax, %ax + mov %ax, %es + + mov $0x02, %ah + mov $0x01, %al + mov $0x5000, %bx + mov $0x00, %ch + mov $0x01, %cl + mov $0x00, %dh + movb (_cur_drive),%dl + int $0x13 + + mov $0x5003,%si + mov $_ls_dlabl,%di + mov $31, %cx + rep movsb + + mov $_ls_label,%si + call _printk + mov $_ls_dlabl,%si + call _printk + mov $_new_line,%si + call _printk + + _ls_done: + ret + + .section .rodata + _ls_file: .fill 21,1,0 + _ls_dlabl: .fill 32,1,0 + + _ls_label: .asciz "\r\nDISK DRIVE LABEL: " diff --git a/kernel/fs/mk.S b/kernel/fs/mk.S new file mode 100644 index 0000000..2545325 --- /dev/null +++ b/kernel/fs/mk.S @@ -0,0 +1,76 @@ + + .code16 + .global _mk_file + .section .text + + # + # %si - input file + # %dl - disk drive + # + _mk_file: + + # + # save cmd args + # + push %cx + + mov $_mk_infile,%di + mov $16, %cx + rep movsb + + mov $0x0d, %al + stosb + pop %cx + + # does a file with + # the same name + # already exists + mov $_mk_infile,%si + movb (_cur_drive),%dl + call _find_file + jc _mk_exsists + + # check if there + # are any empty spaces + call _find_empty + jnc _mk_no_space + + # + # write the file to disk + # + + # move the file name to + # 0x5000 + push %cx + mov $_mk_infile,%si + mov $0x5000,%di + mov $16, %cx + rep movsb + pop %cx + + mov $0x03, %ah + mov $0x01, %al + mov $0x5000, %bx + mov $0x01, %cl + mov $0x00, %dh + int $0x13 + + ret + + _mk_no_space: + mov $_mk_dfull, %si + call _printk + + ret + + _mk_file_exsits: + mov $_mk_exsists,%si + call _printk + + ret + + .section .rodata + _mk_dfull: .asciz "\tNo available disk space.\r\n" + _mk_exsists: .asciz "\tFile with the same name already exists.\r\n" + + _mk_infile: .fill 17,1,0 diff --git a/kernel/fs/rm.S b/kernel/fs/rm.S new file mode 100644 index 0000000..349e3e9 --- /dev/null +++ b/kernel/fs/rm.S @@ -0,0 +1,58 @@ + + .code16 + .global _rm_file + .section .text + + # + # %si - filename to remove + # + # NOTE: + # only input one file + # when running the cmd + # + _rm_file: + movb (_cur_drive),%dl + call _find_file + jnc _rm_not_found + + mov $0x03, %ah + mov $0x12, %al + mov $0x4000, %bx + mov $0x01, %cl + mov $0x00, %dh + movb (_cur_drive),%dl + int $0x13 + jc _rm_error + + mov $0x03, %ah + mov $0x12, %al + mov $0x4000, %bx + inc %ch + mov $0x01, %cl + mov $0x00, %dh + movb (_cur_drive),%dl + int $0x13 + jc _rm_error + + _rm_done: + ret + + _rm_not_found: + mov $_rm_file_nf,%si + call _printk + + ret + + _rm_error: + mov $0x0e, %ah + mov $'!', %al + int $0x10 + + ret + + .section .rodata + _rm_no_file: .asciz "\tNo file input.\r\n\trm [file]\r\n" + _rm_file_nf: .asciz "\tInput file not found.\r\n" + + _rm_infile: .fill 17,1,0 + _rm_tmfile: .fill 17,1,0 diff --git a/kernel/kernel.ld b/kernel/kernel.ld index b4423db..683eacf 100644 --- a/kernel/kernel.ld +++ b/kernel/kernel.ld @@ -1,41 +1,27 @@ - OUTPUT_FORMAT(binary); -ENTRY(_entry); +ENTRY(_kernel_start); SECTIONS { - . = 0x7e00; + . = 0x0500; .text : SUBALIGN(0) { - *(.text.kernel); - *(.text.filesys); - *(.text.libk); + *(.text.main); *(.text) } .rodata : SUBALIGN(0) { - *(.rodata.kernel); - *(.rodata.filesys); - *(.rodata.mp); *(.rodata) } .data : SUBALIGN(0) { - *(.data.filesys); *(.data); - *(.data.pinb); - } - - .blocks : SUBALIGN(0) - { - *(.blocks); } /DISCARD/ : { - *(.comment); *(.note*) } -} +} \ No newline at end of file diff --git a/kernel/kernel.mk b/kernel/kernel.mk index 76e4b43..3b3d1b8 100644 --- a/kernel/kernel.mk +++ b/kernel/kernel.mk @@ -1,14 +1,12 @@ - ARCH=i386-elf AS=$(ARCH)-as -LD=$(ARCH)-ld -NASM=nasm -fbin +LD=$(ARCH)-ld override BIN := ./bin/kernel.sys override ASM := $(shell find ./kernel -type f -name '*.S') -override OBJ := $(ASM:.S=.o) +override OBJ := $(ASM:.S=.s_o) .PHONY: all all: $(BIN) @@ -16,11 +14,10 @@ all: $(BIN) $(BIN): $(OBJ) $(LD) -Tkernel/kernel.ld $(OBJ) -o $@ -%.o: %.S +%.s_o: %.S $(AS) $< -o $@ .PHONY: clean clean: rm $(OBJ) rm $(BIN) - diff --git a/kernel/libk/panic.S b/kernel/libk/panic.S deleted file mode 100644 index babd567..0000000 --- a/kernel/libk/panic.S +++ /dev/null @@ -1,164 +0,0 @@ - - .section .text.libk - .global _panic - .code16 - - _panic: - call _clear - - mov $0x09, %ah - mov $0x20, %al - mov $0x00, %bh - mov $0x4f, %bl - mov $2240, %cx - int $0x10 - - mov $_pm_0, %si - call _printk - - mov $_pm_1, %si - call _printk - - mov $_pm_2, %si - call _printk - - # - # Print registers - # - - mov $_pm_ax,%si - call _printk - movw %ax, (regi) - call _preg - - mov $_pm_bx,%si - call _printk - movw %bx, (regi) - call _preg - - mov $_pm_cx,%si - call _printk - movw %cx, (regi) - call _preg - - mov $_pm_dx,%si - call _printk - movw %dx, (regi) - call _preg - - mov $_nwln, %si - call _printk - - # - # - # - - mov $_pm_sp,%si - call _printk - movw %sp, (regi) - call _preg - - mov $_pm_bp,%si - call _printk - movw %bp, (regi) - call _preg - - mov $_pm_si,%si - call _printk - movw %si, (regi) - call _preg - - mov $_pm_di,%si - call _printk - movw %di, (regi) - call _preg - - mov $_nwln, %si - call _printk - - # - # - # - - mov $_pm_cs,%si - call _printk - movw %cs, (regi) - call _preg - - mov $_pm_ds,%si - call _printk - movw %ds, (regi) - call _preg - - mov $_pm_es,%si - call _printk - movw %es, (regi) - call _preg - - mov $_pm_fs,%si - call _printk - movw %fs, (regi) - call _preg - - mov $_nwln, %si - call _printk - - # - # - # - - mov $_pm_gs,%si - call _printk - movw %gs, (regi) - call _preg - - mov $_pm_ss,%si - call _printk - movw %ss, (regi) - call _preg - - # - # OS Info - # - mov $_pm_3, %si - call _printk - - mov $_pm_i1, %si - call _printk - - mov $_pm_i2, %si - call _printk - - mov $0x00, %ax - int $0x16 - int $0x19 - - cli - hlt - - .section .rodata - _nwln: .asciz "\r\n" - _pm_0: .asciz "**** OS KERNEL HALTED ****\r\n\r\n" - _pm_1: .asciz " OS kernel has experienced a fatal error and has halted program execution.\r\n" - _pm_2: .asciz " Restart your computer. Registers dumped:\r\n\r\n" - - _pm_ax: .asciz " AX : " - _pm_bx: .asciz " BX : " - _pm_cx: .asciz " CX : " - _pm_dx: .asciz " DX : " - - _pm_sp: .asciz " SP : " - _pm_bp: .asciz " BP : " - _pm_si: .asciz " SI : " - _pm_di: .asciz " DI : " - - _pm_cs: .asciz " CS : " - _pm_ds: .asciz " DS : " - _pm_es: .asciz " ES : " - _pm_fs: .asciz " FS : " - _pm_gs: .asciz " GS : " - _pm_ss: .asciz " SS : " - - _pm_3: .asciz "\r\n\r\n OS Information:\r\n" - _pm_i1: .asciz " Kernel: v5.5.0 \"Los Angeles\"\r\n" - _pm_i2: .asciz " OS: OS/1 Average Release 5.5.0" diff --git a/kernel/libk/stdio.S b/kernel/libk/stdio.S index f820f20..784db2e 100644 --- a/kernel/libk/stdio.S +++ b/kernel/libk/stdio.S @@ -1,117 +1,88 @@ - - .code16 - .global _printk - .global _preg - .global _clear - .global _strcmp - .section .text.libk - - # - # _clear: clears the screen - # - _clear: - mov $0x03, %ax - int $0x10 - - # Set pallete register - mov $0x1003,%ax - mov $0x00, %bl - int $0x10 - - # Set up the font - mov $0x11, %ah - mov $0x11, %al - int $0x10 + .code16 + .global _printk + .global _preg + .global _strcmp + .section .text - ret + _printk: + lodsb - # - # _printk: prints strings in SI register - # - _printk: - lodsb + or %al, %al + jz .done_printk - or %al, %al - jz .pk_done + cmp $0x09, %al + je .handle_tab - cmp $0x09, %al - je .handle_tab + mov $0x0e, %ah + int $0x10 - mov $0x0e, %ah - int $0x10 + jmp _printk - jmp _printk + .handle_tab: + mov $0x0e, %ah + mov $' ', %al + int $0x10 + int $0x10 + int $0x10 + int $0x10 - .handle_tab: - mov $0x0e, %ah - mov $' ', %al - int $0x10 - int $0x10 - int $0x10 - int $0x10 + jmp _printk - jmp _printk + .done_printk: + ret - .pk_done: - ret - # - # _preg: prints value of a register - # - _preg: - mov $ostr, %di - mov (regi), %ax - mov $hstr, %si - mov $0x04, %cx + _preg: + mov $out_str, %si + mov (reg_in), %ax + mov $hex_str, %si + mov $0x04, %cx - .preg_loop: - rol $0x04, %ax # Might cause problems later on, if enabled pc returns an error - mov %ax, %bx - and $0x0f, %bx + .preg_loop: + rol $0x04, %ax + mov %ax, %bx + and $0x0f, %bx - movb (%bx, %si), %bl + movb (%bx,%si), %bl - movb %bl, (%di) + movb %bl, (%di) - inc %di - dec %cx + inc %di + dec %cx - jnz .preg_loop + jnz .preg_loop - mov $ostr, %si - call _printk + mov $out_str,%si + call _printk - ret + ret + + _strcmp: + + _str_loop: + mov (%si), %al + mov (%di), %bl + cmp %bl, %al + jne _not_equal + + cmp $0x00, %al + je _equal - # - # _strcmp: compare two strings in registers - # %di and %si - # - _strcmp: - _strcmp_l: - mov (%si), %al - mov (%di), %bl - cmp %bl, %al - jne _notequal - - cmp $0x00, %al - je _strcmp_d - - inc %di - inc %si - - jmp _strcmp_l - - _notequal: - clc - ret - - _strcmp_d: - stc - ret - - .section .data - .global regi - ostr: .asciz "0000 " - hstr: .asciz "0123456789ABCDEF" + inc %di + inc %si + + jmp _str_loop - regi: .word 0 \ No newline at end of file + _not_equal: + clc + ret + + _equal: + stc + ret + + .section .data + .global reg_in + out_str: .asciz "0000" + hex_str: .asciz "0123456789ABCDEF" + + reg_in: .word 0 diff --git a/kernel/mp/cmd.S b/kernel/mp/cmd.S deleted file mode 100644 index cb8c34c..0000000 --- a/kernel/mp/cmd.S +++ /dev/null @@ -1,36 +0,0 @@ - - # Power - _mp_cmd_rebt: .asciz "reboot" # Warm reboot (int 0x19) - _mp_cmd_shutd: .asciz "shutdown" # Power off the sys. (QEMU, Virtualbox) - - # Memory - _mp_cmd_mem: .asciz "mem" # Get the amount of free (low) memory in hex - - # Disk(s) - _mp_cmd_dstat: .asciz "dstat" # Status from the disk drive / check for disk drive errors - - _mp_cmd_load_a: .asciz "load a" # Load data from disk in drive A (from 0x7e00+) and jump to 0x7e00 - _mp_cmd_load_b: .asciz "load b" # Load data from disk in drive B (from 0x7e00+) and jump to 0x7e00 - - # BBFS - _mp_cmd_bbfs: .asciz "bbfs" # Display disk info - - _mp_cmd_ram1: .asciz "ram read 1" # read RAM block #1 into memory @ 0xAA00 - _mp_cmd_ram2: .asciz "ram read 2" # read RAM block #2 into memory @ 0xAA00 - _mp_cmd_ram3: .asciz "ram read 3" # read RAM block #3 into memory @ 0xAA00 - _mp_cmd_ram4: .asciz "ram read 4" # read RAM block #4 into memory @ 0xAA00 - _mp_cmd_ram5: .asciz "ram read 5" # read RAM block #5 into memory @ 0xAA00 - - _mp_cmd_rexe: .asciz "ram exec" # jump to 0xAA00 and run the code there - - # Others - _mp_cmd_ver: .asciz "ver" # Display version string - _mp_cmd_clear: .asciz "clear" # Clear the screen - _mp_cmd_help: .asciz "help" # Help command - - _mp_cmd_die: .asciz "die" # Cause a kernel panic - - _mp_cmd_echo: .asciz "echo" # print out user input - - # Pinboard - _mp_cmd_pinb: .asciz "pinb" # Start the pinboard enviroment diff --git a/kernel/mp/cmds.S b/kernel/mp/cmds.S new file mode 100644 index 0000000..66c813e --- /dev/null +++ b/kernel/mp/cmds.S @@ -0,0 +1,45 @@ + + # + # list of all comands located in MP + # + + _mp_cmd_reboot: .asciz "reboot" # reboot the pc + _mp_cmd_shutdown: .asciz "shutdown" # shutdown the pc + + # + # MP stuff + # + _mp_cmd_rem: .asciz "#" # a comment + _mp_cmd_echo: .asciz "echo" # echo user input + _mp_cmd_clear: .asciz "clear" # clear the screen + _mp_cmd_ver: .asciz "ver" # display version info + _mp_cmd_help: .asciz "help" # help message + + # + # File system & disk commands + # + _mp_cmd_ls: .asciz "ls" # list all files on the disk + _mp_cmd_rm: .asciz "rm" # remove a file from the disk + _mp_cmd_mk: .asciz "mk" # create a file + + _mp_cmd_format: .asciz "format" # format a disk + _mp_cmd_system: .asciz "sys" # make a disk bootable (copy the bootld. & the kernel file) + + _mp_cmd_disk_a: .asciz "a:" # switch to disk in the drive A (0x00) + _mp_cmd_disk_b: .asciz "b:" # switch to disk in the drive B (0x01) +/* + Hard drive support? + In OS/1? + + _mp_cmd_disk_c: .asciz "c:" # switch to the 1st HDD (0x80) + _mp_cmd_disk_d: .asciz "d:" # switch to the 2nd HDD (0x81) +*/ + + # + # Plain ArChiver Kit (PACK) commands + # + _mp_cmd_pack: .asciz "pack" # create a .pak file archive + _mp_cmd_unpack: .asciz "unpack" # extract a .pak file + + # The eDitor + _mp_cmd_td: .asciz "td" # run the text editor (td) diff --git a/kernel/mp/main.S b/kernel/mp/main.S index a175a8a..dac7ee4 100644 --- a/kernel/mp/main.S +++ b/kernel/mp/main.S @@ -1,374 +1,109 @@ - /* - Monitor Program for OS/1 - (MP-OS/1) - ================================ + .code16 + .global _mp + .global _clear_buffer + .section .text - Monitor Program for OS/1 or MP-OS/1 is a - simple program that allows users to - "monitor" the system. Its main function - is to let the user load and write data - to the disk(s). + _mp: + mov $_buffer, %di + xor %cx, %cx - */ + _mp_main: + mov $_prompt, %si + call _printk + xor %cx, %cx + mov $_buffer, %di + call _input - .code16 - .section .text.mp - .global _input - .extern _entry - #.global _monitor_program + mov $_buffer, %si + cmpb $0x0000, (%si) + je _mp_main - # - # _monitor_program - main program point. - # - takes user input - # - if it matches a command, then - # execute it - # - if there is no match, then return - # an error. - # - _input: + mov $_buffer, %si + call _cmd_parser - mov $_mp_prompt, %si - call _printk + mov $_buffer, %di + xor %cx, %cx + call _clear_buffer - mov $_input_buffer, %di - call _get_input + jmp _mp_main - mov $_input_buffer, %si - cmpb $0x0000, (%si) - je _input - - # - # Basics (reboot, shutdown) - # - mov $_input_buffer, %si - mov $_mp_cmd_rebt, %di - call _strcmp - jc _reboot - - mov $_input_buffer, %si - mov $_mp_cmd_shutd, %di - call _strcmp - jc _shutdown - - # - # Memory (mem. stat. , peek & poke) - # - mov $_input_buffer, %si - mov $_mp_cmd_mem, %di - call _strcmp - jc _mem - - # - # Load command(s) - # - mov $_input_buffer, %si - mov $_mp_cmd_load_a,%di - call _strcmp - jc _loada - - mov $_input_buffer, %si - mov $_mp_cmd_load_b,%di - call _strcmp - jc _loadb - - # - # Disk status - # - mov $_input_buffer, %si - mov $_mp_cmd_dstat, %di - call _strcmp - jc _dstat - - # - # Others (ver. and clear) - # - mov $_input_buffer, %si - mov $_mp_cmd_clear,%di - call _strcmp - jc _clear - - mov $_input_buffer, %si - mov $_mp_cmd_ver,%di - call _strcmp - jc _ver - - # - # Help command - # - mov $_input_buffer, %si - mov $_mp_cmd_help, %di - call _strcmp - jc _help - - # - # Pinboard enviroment - # - mov $_input_buffer, %si - mov $_mp_cmd_pinb, %di - call _strcmp - jc _penv - - # - # kernel panic - # - mov $_input_buffer, %si - mov $_mp_cmd_die, %di - call _strcmp - jc _die - - # - # BBFS - # - mov $_input_buffer, %si - mov $_mp_cmd_bbfs, %di - call _strcmp - jc _bbfs - - mov $_input_buffer, %si - mov $_mp_cmd_ram1, %di - call _strcmp - jc _ram_read_1 - - mov $_input_buffer, %si - mov $_mp_cmd_ram2, %di - call _strcmp - jc _ram_read_2 - - mov $_input_buffer, %si - mov $_mp_cmd_ram3, %di - call _strcmp - jc _ram_read_3 - - mov $_input_buffer, %si - mov $_mp_cmd_ram4, %di - call _strcmp - jc _ram_read_4 - - mov $_input_buffer, %si - mov $_mp_cmd_ram5, %di - call _strcmp - jc _ram_read_5 - - mov $_input_buffer, %si - mov $_mp_cmd_rexe, %di - call _strcmp - jc _ram_exec - - # Command not found? Return an "?" - mov $_input_buffer, %si - call _printk - mov $_mp_str_err, %si - call _printk - - jmp _input - - _get_input: - xor %cl, %cl - - _get_input_l: - mov $0x00, %ah - int $0x16 - - cmp $0x08, %al - je _backspace - - cmp $0x0d, %al - je _returnk - - cmp $0xff, %cl - je _get_input_l - - mov $0x0e, %ah - int $0x10 - - stosb - inc %cl - jmp _get_input_l - - _backspace: - cmp $0x00, %cl - je _get_input_l - - dec %di - movb $0x00, (%di) - dec %cl - - mov $0x0e, %ah - mov $0x08, %al - int $0x10 - - mov $0x20, %al - int $0x10 - - mov $0x08, %al - int $0x10 - - jmp _get_input_l + # + # Get user input + # - _returnk: - mov $0x00, %al - stosb + _input: + mov $0x00, %ah + int $0x16 - mov $0x0e, %ah - mov $0x0d, %al - int $0x10 + cmp $0x08, %al + je _backspace - mov $0x0a, %al - int $0x10 + cmp $0x0D, %al + je _return - ret + cmp $0x60, %cl + je _input - ################################# - # COMMANDS # - ################################# + mov $0x0e, %ah + int $0x10 - _reboot: - jmp $0xFFFFF, $0 + stosb + inc %cl + jmp _input - _shutdown: - xor %ax, %ax - xor %bx, %bx - - mov $0x1000,%ax - mov %ss, %ax - mov $0xf000,%sp - mov $0x5307,%ax - mov $0x0001,%bx - mov $0x0003,%cx - int $0x15 - - _mem: - mov $_mp_str_mem, %si - call _printk - - xor %ax, %ax - clc - - int $0x12 - - movw %ax, (regi) - call _preg - - call _returnk - - jmp _input - - _ver: - mov $_mp_str_ver, %si - call _printk + _backspace: + cmp $0x00, %cl + je _input - jmp _input + dec %di + movb $0x00, (%di) + dec %cl - _clear: - mov $0x03, %ax + mov $0x0e, %ah + mov $0x08, %al int $0x10 - # Set pallete register - mov $0x1003,%ax - mov $0x00, %bl + mov $0x20, %al int $0x10 - # Set up the font - mov $0x11, %ah - mov $0x11, %al + mov $0x08, %al int $0x10 - jmp _input - - _dstat: - xor %dx, %dx - xor %ax, %ax - call _disk_status jmp _input - _loada: - call _load_A - jmp _input - - _loadb: - call _load_B - jmp _input - - _die: - jmp _panic - - _bbfs: - call _bbfs_print_info + _return: + mov $0x00, %al + stosb - jmp _input - - _help: - mov $_mp_str_help, %si - call _printk - - jmp _input - - _ram_read_1: - mov $0x01, %ax - mov $512, %cx - call _bbfs_read_ram_block - jmp _input - - _ram_read_2: - mov $0x02, %ax - mov $512, %cx - call _bbfs_read_ram_block - jmp _input - - _ram_read_3: - mov $0x03, %ax - mov $512, %cx - call _bbfs_read_ram_block - jmp _input - - _ram_read_4: - mov $0x04, %ax - mov $512, %cx - call _bbfs_read_ram_block - jmp _input - - _ram_read_5: - mov $0x05, %ax - mov $512, %cx - call _bbfs_read_ram_block - jmp _input - - _ram_exec: - jmp _bbfs_ram_exec + mov $0x0e, %ah + mov $0x0d, %al + int $0x10 - _penv: - jmp _pinb + mov $0x0a, %al + int $0x10 - .section .rodata.mp + ret - _mp_new_line: .asciz "\r\n" - - _mp_str_ver: .asciz "\tMonitor Program for OS/1 (MP-OS/1) Version 1.3.0\r\n" - _mp_str_mem: .asciz "\tKB of low memory (in hex.): " - - _mp_prompt: .asciz "% " - _mp_str_err: .asciz "?\r\n\n" + # + # Clear the _buffer + # + _clear_buffer: + mov $0, %al # Fill buffer with null characters + mov $96, %cx # Buffer size + rep stosb # Clear buffer + ret - _mp_str_help: .ascii "\tList of commands:\r\n" - .ascii "\t\t- reboot\r\n\t\t- shutdown\r\n" - .ascii "\t\t- mem\r\n\t\t- dstat\r\n" - .ascii "\t\t- load a\r\n\t\t- load b\r\n" - .ascii "\t\t- ver\r\n\t\t- clear\r\n" - .ascii "\t\t- die\r\n\t\t- bbfs\r\n" - .ascii "\t\t- pinb\r\n" - .ascii "\t\t- ram read 1/2/3/4/5\r\n" - .ascii "\t\t- ram exec\r\n" - .asciz "\t\t- help\r\n" + _end: + cli + hlt - .section .data - .include "./kernel/mp/cmd.S" + .section .rodata + _prompt: .asciz "% " # command line prompt - # - # _input_buffer - stores user input (3254-byte limit) - # 0xAC00 - 0x7c00 -> 0x3000 - # First block should be @ 0x3000, alter the size of - # input buffer as needed. - _input_buffer: .fill 256, 1, 0 + .include "kernel/mp/cmds.S" + .section .data + .global _buffer + _buffer: .fill 97,1,0 # maximum of 96 chars (+1 for \0) diff --git a/kernel/mp/parse.S b/kernel/mp/parse.S new file mode 100644 index 0000000..6111b67 --- /dev/null +++ b/kernel/mp/parse.S @@ -0,0 +1,308 @@ + + .code16 + .global _cmd_parser + .section .text + + _cmd_parser: + mov $_buffer, %si + mov $_command, %di + + # copy the _buffer until + # you encounter a " " char. + _get_cmd: + movb (%si), %al + + cmp $0x00, %al + je _get_args + + cmp $0x20, %al + je _get_args + + movb %al, (%di) + + inc %si + inc %di + + jmp _get_cmd + + # save everything after " " + # in _arguments + _get_args: + inc %si + mov %si, %bx + mov $_arguments,%di + + _arg_loop: + movb (%si), %al + + cmp $0x00, %al + je _arg_done + + movb %al, (%di) + + inc %si + inc %di + + jmp _arg_loop + + _arg_done: + movb $0x00, (%di) + movb $0x00, 1(%di) + + # compare _buffer to the + # list of commands. If + # the _buffer is match + # with the commands then + # execute the command + + # reboot + mov $_command,%si + mov $_mp_cmd_reboot,%di + call _strcmp + jc _reboot + + # shutdown + mov $_command,%si + mov $_mp_cmd_shutdown,%di + call _strcmp + jc _shutdown + + # echo + mov $_command,%si + mov $_mp_cmd_echo,%di + call _strcmp + jc _echo + + # clear + mov $_command,%si + mov $_mp_cmd_clear,%di + call _strcmp + jc _clear + + # comment + mov $_command,%si + mov $_mp_cmd_rem,%di + call _strcmp + jc _comment + + # ver + mov $_command,%si + mov $_mp_cmd_ver,%di + call _strcmp + jc _ver + + # ls + mov $_command,%si + mov $_mp_cmd_ls,%di + call _strcmp + jc _ls_dir + + # rm + mov $_command,%si + mov $_mp_cmd_rm,%di + call _strcmp + jc _rm_pre + + # mk + mov $_command,%si + mov $_mp_cmd_mk,%di + call _strcmp + jc _mk_pre + + # disk a + mov $_command,%si + mov $_mp_cmd_disk_a,%di + call _strcmp + jc _disk_a + + # disk b + mov $_command,%si + mov $_mp_cmd_disk_b,%di + call _strcmp + jc _disk_b + + # format + mov $_command,%si + mov $_mp_cmd_format,%di + call _strcmp + jc _format_pre + + # td + mov $_command,%si + mov $_mp_cmd_td,%di + call _strcmp + jc _td + + # in the case that the + # user input doesn't + # match any of the + # commands, try to load + # the file of the same name + mov $_command, %si + movb (_cur_drive),%dl + call _find_file + jc _go_to_handler + jnc _nothing + + mov $_command, %di + xor %cx, %cx + call _clear_buffer + + ret + + _nothing: + # and if that fails + # return an error msg. + mov $_no_cmd, %si + call _printk + + mov $_command, %di + xor %cx, %cx + call _clear_buffer + + ret + + _go_to_handler: + mov $_command, %si + call _handle_file + + mov $_command, %di + xor %cx, %cx + call _clear_buffer + + ret + + # + # Commands built in + # + + # reboot + _reboot: + jmp $0xFFFFF,$0 + + # shutdown + _shutdown: + xor %ax, %ax + xor %bx, %bx + + mov $0x1000,%ax + mov %ss, %ax + mov $0xf000,%sp + mov $0x5307,%ax + mov $0x0001,%bx + mov $0x0003,%cx + int $0x15 + + # echo + _echo: + mov $_arguments,%si + call _printk + + mov $_new_line, %si + call _printk + + mov $_command, %di + xor %cx, %cx + call _clear_buffer + + ret + + # clear + _clear: + # clear scr. + mov $0x03, %ax + int $0x10 + + # Set pallete register + mov $0x1003, %ax + mov $0x00, %bl + int $0x10 + + # Set up the font + mov $0x11, %ah + mov $0x11, %al + int $0x10 + + mov $_command, %di + xor %cx, %cx + call _clear_buffer + + jmp _mp + + # comment + _comment: + mov $_command, %di + xor %cx, %cx + call _clear_buffer + + ret + + # ver + _ver: + mov $_ver_str, %si + call _printk + + mov $_command, %di + xor %cx, %cx + call _clear_buffer + + ret + + # landing for _rm + _rm_pre: + mov $_arguments,%si + call _rm_file + + mov $_command, %di + xor %cx, %cx + call _clear_buffer + ret + + # landing for _mk + _mk_pre: + mov $_arguments,%si + movb (_cur_drive),%dl + call _mk_file + + mov $_command, %di + xor %cx, %cx + call _clear_buffer + ret + + # switch to a: + _disk_a: + movb $0x00, _cur_drive + ret + + # switch to b: + _disk_b: + movb $0x01, _cur_drive + ret + + _format_pre: + mov $_arguments,%si + movb (_cur_drive),%dl + call _format_disk + + mov $_command, %di + xor %cx, %cx + call _clear_buffer + ret + + .section .rodata + .global _new_line + _new_line: .asciz "\r\n" + + _ver_str: .asciz "\tOperating System/1 v6.0.0\r\n" + + _no_cmd: .asciz "Unknow command or file.\r\n\n" + + .include "kernel/mp/cmds.S" + + + .section .data + .global _cur_drive + _cur_drive: .byte 0 # current disk drive + + _command: .fill 33,1,0 # 32 char command name (+1 for \0) + _arguments: .fill 65,1,0 # 65 char command arguments (+1 for \0) diff --git a/kernel/pinb/README.txt b/kernel/pinb/README.txt deleted file mode 100644 index 5791c50..0000000 --- a/kernel/pinb/README.txt +++ /dev/null @@ -1,16 +0,0 @@ - Pinboard Environment -============================ - - Pinboard Environment or just Pinb for - short is a simple "graphical" environment - written for OS/1 (but it can be used for - other operating systems). - - It was first introduced in OS/1 3.0.0 and - since than has been an integral part of - OS/1, making up about 64.69% of its total - code. - - Pinb doesn't offer much. Just a simple - text editor, a paint program, and a - shortcut to the shell. diff --git a/kernel/pinb/about.S b/kernel/pinb/about.S deleted file mode 100644 index ccd5c14..0000000 --- a/kernel/pinb/about.S +++ /dev/null @@ -1,155 +0,0 @@ - - .code16 - .section .text.pinb - .global _about - - _about: - mov $0x02, %ah - mov $02, %dh - mov $01, %dl - int $0x10 - - .a_set: - mov $0x02, %ah - inc %dh - mov $01, %dl - int $0x10 - - mov $0x09, %ah - mov $0x20, %al - mov $0x00, %bh - mov $0x1F, %bl - mov $50, %cx - int $0x10 - - cmp $18, %dh - je .a_title - - jmp .a_set - - .a_title: - mov $0x02, %ah - mov $0x02, %dh - mov $0x01, %dl - int $0x10 - - mov $0x09, %ah - mov $0x20, %al - mov $0x00, %bh - mov $0xF1, %bl - mov $50, %cx - int $0x10 - - mov $_a_title, %si - call _printk - - .a_border: - mov $0x02, %ah - mov $02, %dh - mov $01, %dl - int $0x10 - - .ab_left: - mov $0x02, %ah - inc %dh - mov $01, %dl - int $0x10 - - mov $0x09, %ah - mov $0xBA, %al - mov $0x00, %bh - mov $0xF1, %bl - mov $01, %cx - int $0x10 - - cmp $8, %dh - je .ab_i1 - - jmp .ab_left - - .ab_i1: - mov $0x02, %ah - mov $02, %dh - mov $01, %dl - int $0x10 - - .ab_right: - mov $0x02, %ah - inc %dh - mov $50, %dl - int $0x10 - - mov $0x09, %ah - mov $0xBA, %al - mov $0x00, %bh - mov $0xF1, %bl - mov $01, %cx - int $0x10 - - cmp $8, %dh - je .ab_down - - jmp .ab_right - .ab_down: - mov $0x02, %ah - mov $0x01, %dl - int $0x10 - - mov $0x09, %ah - mov $0xCD, %al - mov $0x00, %bh - mov $0xF1, %bl - mov $50, %cx - int $0x10 - - mov $0x0e, %ah - mov $0xC8, %al - int $0x10 - - mov $0x02, %ah - mov $50, %dl - int $0x10 - - mov $0x0e, %ah - mov $0xBC, %al - int $0x10 - - .a_content: - mov $0x02, %ah - mov $0x04, %dh - mov $0x0D, %dl - int $0x10 - - mov $_header,%si - call _printk - - mov $0x02, %ah - mov $0x05, %dh - mov $0x0B, %dl - int $0x10 - - mov $0x09, %ah - mov $0xC4, %al - mov $0x00, %bh - mov $0x1F, %bl - mov $0x1D, %cx - int $0x10 - - mov $0x02, %ah - mov $0x06, %dh - mov $0x09, %dl - int $0x10 - - mov $_copyrg,%si - call _printk - - jmp _about_curs - - cli - hlt - - .section .rodata.pinb - _a_title: .asciz " \xB3\xFE\xB3 About" - - _header: .asciz "Operating System/1 v5.5.0" - _copyrg: .asciz "Copyright (C) 2024 \xB3 Build 260124" diff --git a/kernel/pinb/curs/about_curs.S b/kernel/pinb/curs/about_curs.S deleted file mode 100644 index 56c46e9..0000000 --- a/kernel/pinb/curs/about_curs.S +++ /dev/null @@ -1,128 +0,0 @@ - - .code16 - .section .text.pinb - .global _about_curs - - _about_curs: - mov $0x01, %ah - mov $0x10, %cx - int $0x10 - - mov $0x03, %bl - mov $0x02, %cl - - .ac_loop: - mov $0x02, %ah - mov %cl, %dh - mov %bl, %dl - int $0x10 - - mov $0x00, %ah - int $0x16 - - cmp $0x48, %ah - je .up - - cmp $0x50, %ah - je .down - - cmp $0x4B, %ah - je .left - - cmp $0x4D, %ah - je .right - - cmp $0x20, %al - je .click - - jmp .ac_loop - - .up: - cmp $0x00, %cl - je .ac_loop - - sub $0x01, %cl - jmp .ac_loop - - .down: - cmp $0x1B, %cl - je .ac_loop - - add $0x01, %cl - jmp .ac_loop - - .left: - cmp $0x00, %bl - je .ac_loop - - sub $0x01, %bl - jmp .ac_loop - - .right: - cmp $79, %bl - je .ac_loop - - add $0x01, %bl - jmp .ac_loop - - .click: - cmp $0x02, %dh - je .bar - - cmp $0x00, %dh - je .tbar - - jmp .ac_loop - - /* - Actions - */ - .tbar: - cmp $0x02, %dl - je _home - cmp $0x03, %dl - je _home - cmp $0x04, %dl - je _home - cmp $0x05, %dl - je _home - cmp $0x06, %dl - je _home - cmp $0x07, %dl - je _home - cmp $0x08, %dl - je _home - cmp $0x09, %dl - je _home - - jmp .ac_loop - - .bar: - cmp $0x03, %dl - je _a_clear - - jmp .ac_loop - - _a_clear: - mov $0x02, %ah - mov $01, %dh - mov $01, %dl - int $0x10 - - .a_cloop: - mov $0x02, %ah - inc %dh - mov $01, %dl - int $0x10 - - mov $0x09, %ah - mov $0x20, %al - mov $0x00, %bh - mov $0x1F, %bl - mov $50, %cx - int $0x10 - - cmp $18, %dh - je _desk_curs - - jmp .a_cloop diff --git a/kernel/pinb/curs/desk_curs.S b/kernel/pinb/curs/desk_curs.S deleted file mode 100644 index 0e7de18..0000000 --- a/kernel/pinb/curs/desk_curs.S +++ /dev/null @@ -1,111 +0,0 @@ - - .code16 - .section .text.pinb - .global _desk_curs - - _desk_curs: - mov $0x01, %ah - mov $0x10, %cx - int $0x10 - - mov $13, %cl - mov $40, %bl - - .dc_loop: - mov $0x02, %ah - mov %cl, %dh - mov %bl, %dl - int $0x10 - - mov $0x00, %ah - int $0x16 - - cmp $0x48, %ah - je .up - - cmp $0x50, %ah - je .down - - cmp $0x4B, %ah - je .left - - cmp $0x4D, %ah - je .right - - cmp $0x20, %al - je .click - - jmp .dc_loop - - .up: - cmp $0x00, %cl - je .dc_loop - - sub $0x01, %cl - jmp .dc_loop - - .down: - cmp $0x1B, %cl - je .dc_loop - - add $0x01, %cl - jmp .dc_loop - - .left: - cmp $0x00, %bl - je .dc_loop - - sub $0x01, %bl - jmp .dc_loop - - .right: - cmp $79, %bl - je .dc_loop - - add $0x01, %bl - jmp .dc_loop - - .click: - cmp $0x00, %dh - je .topb - - jmp .dc_loop - - .topb: - cmp $0x02, %dl - je _home - cmp $0x03, %dl - je _home - cmp $0x04, %dl - je _home - cmp $0x05, %dl - je _home - cmp $0x06, %dl - je _home - cmp $0x07, %dl - je _home - cmp $0x08, %dl - je _home - cmp $0x09, %dl - je _home - - cmp $0x0B, %dl - je _about - cmp $0x0C, %dl - je _about - cmp $0x0D, %dl - je _about - cmp $0x0E, %dl - je _about - cmp $0x0F, %dl - je _about - cmp $0x10, %dl - je _about - cmp $0x11, %dl - je _about - cmp $0x12, %dl - je _about - cmp $0x13, %dl - je _about - - jmp .dc_loop diff --git a/kernel/pinb/curs/dsst_curs.S b/kernel/pinb/curs/dsst_curs.S deleted file mode 100644 index 34a4602..0000000 --- a/kernel/pinb/curs/dsst_curs.S +++ /dev/null @@ -1,105 +0,0 @@ - - .code16 - .section .text.pinb - .global _disk_curs - - _disk_curs: - mov $0x01, %ah - mov $0x10, %cx - int $0x10 - - mov $17, %cl - mov $3, %bl - - .dsk_loop: - mov $0x02, %ah - mov %cl, %dh - mov %bl, %dl - int $0x10 - - mov $0x00, %ah - int $0x16 - - cmp $0x48, %ah - je .up - - cmp $0x50, %ah - je .down - - cmp $0x4B, %ah - je .left - - cmp $0x4D, %ah - je .right - - cmp $0x20, %al - je .click - - jmp .dsk_loop - - .up: - cmp $0x00, %cl - je .dsk_loop - - sub $0x01, %cl - jmp .dsk_loop - - .down: - cmp $0x1B, %cl - je .dsk_loop - - add $0x01, %cl - jmp .dsk_loop - - .left: - cmp $0x00, %bl - je .dsk_loop - - sub $0x01, %bl - jmp .dsk_loop - - .right: - cmp $79, %bl - je .dsk_loop - - add $0x01, %bl - jmp .dsk_loop - - .click: - cmp $17, %dh - je .bar - - jmp .dsk_loop - - .bar: - cmp $0x03, %dl - je .return - - jmp .dsk_loop - - .return: - mov $0x02, %ah - mov $16, %dh - mov $1, %dl - int $0x10 - - .rloop: - cmp $24, %dh - je .endd - - mov $0x02, %ah - inc %dh - mov $0x01, %dl - int $0x10 - - mov $0x09, %ah - mov $0x20, %al - mov $0x00, %bh - mov $0x1F, %bl - mov $70, %cx - int $0x10 - - jmp .rloop - - .endd: - jmp _home diff --git a/kernel/pinb/curs/home_curs.S b/kernel/pinb/curs/home_curs.S deleted file mode 100644 index 901e0cf..0000000 --- a/kernel/pinb/curs/home_curs.S +++ /dev/null @@ -1,364 +0,0 @@ - - .code16 - .section .text.pinb - .global _home_curs - - _home_curs: - mov $0x01, %ah - mov $0x10, %cx - int $0x10 - - mov $0x03, %bl - mov $0x02, %cl - - .hc_loop: - mov $0x02, %ah - mov %cl, %dh - mov %bl, %dl - int $0x10 - - mov $0x00, %ah - int $0x16 - - cmp $0x48, %ah - je .up - - cmp $0x50, %ah - je .down - - cmp $0x4B, %ah - je .left - - cmp $0x4D, %ah - je .right - - cmp $0x20, %al - je .click - - jmp .hc_loop - - .up: - cmp $0x00, %cl - je .hc_loop - - sub $0x01, %cl - jmp .hc_loop - - .down: - cmp $0x1B, %cl - je .hc_loop - - add $0x01, %cl - jmp .hc_loop - - .left: - cmp $0x00, %bl - je .hc_loop - - sub $0x01, %bl - jmp .hc_loop - - .right: - cmp $79, %bl - je .hc_loop - - add $0x01, %bl - jmp .hc_loop - - .click: - cmp $0x00, %dh - je .tbar - - cmp $0x02, %dh - je .bar - - cmp $0x03, %dl - je .shell - cmp $0x04, %dl - je .shell - cmp $0x05, %dl - je .shell - cmp $0x06, %dl - je .shell - cmp $0x07, %dl - je .shell - cmp $0x08, %dl - je .shell - cmp $0x09, %dl - je .shell - - cmp $0x0C, %dl - je .paint - cmp $0x0D, %dl - je .paint - cmp $0x0E, %dl - je .paint - cmp $0x0F, %dl - je .paint - cmp $0x10, %dl - je .paint - - cmp $0x13, %dl - je .notes - cmp $0x14, %dl - je .notes - cmp $0x15, %dl - je .notes - cmp $0x16, %dl - je .notes - cmp $0x17, %dl - je .notes -/* - cmp $0x1A, %dl - je .settings - cmp $0x1B, %dl - je .settings - cmp $0x1C, %dl - je .settings - cmp $0x1D, %dl - je .settings - cmp $0x1E, %dl - je .settings - cmp $0x1F, %dl - je .settings - cmp $0x20, %dl - je .settings - cmp $0x21, %dl - je .settings -*/ - cmp $0x24, %dl - je .extras - cmp $0x25, %dl - je .extras - cmp $0x26, %dl - je .extras - cmp $0x27, %dl - je .extras - cmp $0x28, %dl - je .extras - cmp $0x29, %dl - je .extras - cmp $0x2A, %dl - je .extras - cmp $0x2B, %dl - je .extras - - cmp $0x03, %dl - je .loada - cmp $0x04, %dl - je .loada - cmp $0x05, %dl - je .loada - cmp $0x06, %dl - je .loada - cmp $0x07, %dl - je .loada - cmp $0x08, %dl - je .loada - cmp $0x09, %dl - je .loada - cmp $0x0A, %dl - je .loada - - cmp $0x0C, %dl - je .loadb - cmp $0x0D, %dl - je .loadb - cmp $0x0E, %dl - je .loadb - cmp $0x0F, %dl - je .loadb - cmp $0x10, %dl - je .loadb - cmp $0x11, %dl - je .loadb - cmp $0x12, %dl - je .loadb - cmp $0x13, %dl - je .loadb - cmp $0x14, %dl - je .loadb - cmp $0x15, %dl - je .loadb - - jmp .hc_loop - - /* - Actions - */ - .tbar: - cmp $0x0B, %dl - je _about - cmp $0x0C, %dl - je _about - cmp $0x0D, %dl - je _about - cmp $0x0E, %dl - je _about - cmp $0x0F, %dl - je _about - cmp $0x10, %dl - je _about - cmp $0x11, %dl - je _about - cmp $0x12, %dl - je _about - cmp $0x13, %dl - je _about - - .bar: - cmp $0x03, %dl - je _h_clear - - jmp .hc_loop - - .shell: - cmp $0x03, %dh - je _pre_jump - cmp $0x04, %dh - je _pre_jump - cmp $0x05, %dh - je _pre_jump - cmp $0x06, %dh - je _pre_jump - - cmp $0x09, %dh - je .loada - cmp $0x0A, %dh - je .loada - cmp $0x0B, %dh - je .loada - cmp $0x0C, %dh - je .loada - cmp $0x0D, %dh - je .loada - cmp $0x0E, %dh - je .loada - - jmp .hc_loop - - .paint: - cmp $0x03, %dh - je _paint - cmp $0x04, %dh - je _paint - cmp $0x05, %dh - je _paint - cmp $0x06, %dh - je _paint - cmp $0x07, %dh - je _paint -/* - cmp $0x09, %dh - je _prod - cmp $0x0A, %dh - je _prod - cmp $0x0B, %dh - je _prod - cmp $0x0C, %dh - je _prod - cmp $0x0D, %dh - je _prod - - jmp .hc_loop -*/ - - .notes: - cmp $0x03, %dh - je _notes - cmp $0x04, %dh - je _notes - cmp $0x05, %dh - je _notes - cmp $0x06, %dh - je _notes - cmp $0x07, %dh - je _notes - - jmp .hc_loop -/* - .settings: - cmp $0x03, %dh - je _settings - cmp $0x04, %dh - je _settings - cmp $0x05, %dh - je _settings - cmp $0x06, %dh - je _settings - cmp $0x07, %dh - je _settings - - jmp .hc_loop -*/ - - .extras: - cmp $0x03, %dh - je _dstat - cmp $0x04, %dh - je _dstat - cmp $0x05, %dh - je _dstat - cmp $0x06, %dh - je _dstat - cmp $0x07, %dh - je _dstat - - jmp .hc_loop - - .loada: - cmp $0x09, %dh - je _load_A - cmp $0x0A, %dh - je _load_A - cmp $0x0B, %dh - je _load_A - cmp $0x0C, %dh - je _load_A - cmp $0x0D, %dh - je _load_A - - jmp .hc_loop - - .loadb: - cmp $0x09, %dh - je _load_B - cmp $0x0A, %dh - je _load_B - cmp $0x0B, %dh - je _load_B - cmp $0x0C, %dh - je _load_B - cmp $0x0D, %dh - je _load_B - - - jmp .hc_loop - - _h_clear: - mov $0x02, %ah - mov $01, %dh - mov $01, %dl - int $0x10 - - .h_cloop: - mov $0x02, %ah - inc %dh - mov $01, %dl - int $0x10 - - mov $0x09, %ah - mov $0x20, %al - mov $0x00, %bh - mov $0x1F, %bl - mov $50, %cx - int $0x10 - - cmp $18, %dh - je _desk_curs - - jmp .h_cloop - - _pre_jump: - call _clear - jmp _input diff --git a/kernel/pinb/curs/paint_curs.S b/kernel/pinb/curs/paint_curs.S deleted file mode 100644 index 968bcdc..0000000 --- a/kernel/pinb/curs/paint_curs.S +++ /dev/null @@ -1,630 +0,0 @@ - .code16 - .section .text.pinb.app - .global _paint_curs - - _paint_curs: - - # CL = DH - # BL = DL - - mov $0x01, %ah - mov $0x07, %cx - int $0x10 - - mov $0x02, %dh - mov $0x01, %dl - - pc_loop: - mov $0x02, %ah - int $0x10 - - mov $0x00, %ah - int $0x16 - - # - # Directional keys - # Up, down, left, right - # - - cmp $0x48, %ah - je .up - - cmp $0x50, %ah - je .do_wn - - cmp $0x4B, %ah - je .left - - cmp $0x4D, %ah - je .right - - # - # Base keys - # Space, P, E, N, Esc - # - - cmp $0x20, %al - je .select - - cmp $0x70, %al - je .place - - cmp $0x65, %al - je .erase - - cmp $0x6e, %al - je .new - - cmp $0x1B, %al - je _pinb - - jmp pc_loop - - # - # Directions - # - .up: - cmp $0x00, %dh - je pc_loop - - sub $1, %dh - jmp pc_loop - - .do_wn: - cmp $27, %dh - je pc_loop - - add $1, %dh - jmp pc_loop - - .left: - cmp $0, %dl - je pc_loop - - sub $1, %dl - jmp pc_loop - - .right: - cmp $79, %dl - je pc_loop - - add $1, %dl - jmp pc_loop - - # - # Draw commands - # - .place: - cmp $0x02, %dh - jl pc_loop - - cmp $26, %dh - jg pc_loop - - cmp $0x01, %dl - jl pc_loop - - cmp $72, %dl - jg pc_loop - - mov $0x09, %ah - mov TRANS, %al - mov $0x00, %bh - mov COLOR, %bl - mov $0x01, %cx - int $0x10 - - jmp pc_loop - - .erase: - cmp $0x02, %dh - jl pc_loop - - cmp $26, %dh - jg pc_loop - - cmp $0x01, %dl - jl pc_loop - - cmp $72, %dl - jg pc_loop - - mov $0x09, %ah - mov $0x20, %al - mov $0x00, %bh - mov $0xF0, %bl - mov $0x01, %cx - int $0x10 - - jmp pc_loop - - .new: - mov $0x02, %ah - mov $0x02, %dh - mov $0x01, %dl - int $0x10 - - .nloop: - cmp $27, %dh - je _paint_curs - - mov $0x09, %ah - mov $0x20, %al - mov $0x00, %bh - mov $0xF0, %bl - mov $72, %cx - int $0x10 - - mov $0x02, %ah - inc %dh - mov $0x01, %dl - int $0x10 - - jmp .nloop - - # - # Selection - # - .select: - cmp $0x00, %dh - je .exit - - cmp $0x03, %dh - je .black - - cmp $0x04, %dh - je .blue - - cmp $0x05, %dh - je .green - - cmp $0x06, %dh - je .cyan - - cmp $0x07, %dh - je .red - - cmp $0x08, %dh - je .magenta - - cmp $0x09, %dh - je .brown - - cmp $0x0A, %dh - je .l_gray - - cmp $0x0B, %dh - je .d_gray - - cmp $0x0C, %dh - je .l_blue - - cmp $0x0D, %dh - je .l_green - - cmp $0x0E, %dh - je .l_cyan - - cmp $0x0F, %dh - je .l_red - - cmp $0x10, %dh - je .l_mag - - cmp $0x11, %dh - je .yellow - - cmp $0x12, %dh - je .white - - cmp $0x14, %dh - je .shade0 - - cmp $0x15, %dh - je .shade1 - - cmp $0x16, %dh - je .shade2 - - cmp $0x17, %dh - je .shade3 - - cmp $0x19, %dh - je .news - - jmp pc_loop - - .exit: - cmp $0x02, %dl - je _pinb - - jmp pc_loop - - # - # Colors - # - .black: - cmp $75, %dl - je .do_black - cmp $76, %dl - je .do_black - cmp $77, %dl - je .do_black - cmp $78, %dl - je .do_black - cmp $79, %dl - je .do_black - - jmp pc_loop - - .do_black: - movb $0x0F, COLOR - jmp pc_loop - - .blue: - cmp $75, %dl - je .do_blue - cmp $76, %dl - je .do_blue - cmp $77, %dl - je .do_blue - cmp $78, %dl - je .do_blue - cmp $79, %dl - je .do_blue - - jmp pc_loop - - .do_blue: - movb $0x1F, COLOR - jmp pc_loop - - .green: - cmp $75, %dl - je .do_green - cmp $76, %dl - je .do_green - cmp $77, %dl - je .do_green - cmp $78, %dl - je .do_green - cmp $79, %dl - je .do_green - - jmp pc_loop - - .do_green: - movb $0x2F, COLOR - jmp pc_loop - - .cyan: - cmp $75, %dl - je .do_cyan - cmp $76, %dl - je .do_cyan - cmp $77, %dl - je .do_cyan - cmp $78, %dl - je .do_cyan - cmp $79, %dl - je .do_cyan - - jmp pc_loop - - .do_cyan: - movb $0x3F, COLOR - jmp pc_loop - - .red: - cmp $75, %dl - je .do_red - cmp $76, %dl - je .do_red - cmp $77, %dl - je .do_red - cmp $78, %dl - je .do_red - cmp $79, %dl - je .do_red - - jmp pc_loop - - .do_red: - movb $0x4F, COLOR - jmp pc_loop - - .magenta: - cmp $75, %dl - je .do_magenta - cmp $76, %dl - je .do_magenta - cmp $77, %dl - je .do_magenta - cmp $78, %dl - je .do_magenta - cmp $79, %dl - je .do_magenta - - jmp pc_loop - - .do_magenta: - movb $0x5F, COLOR - jmp pc_loop - - .brown: - cmp $75, %dl - je .do_brown - cmp $76, %dl - je .do_brown - cmp $77, %dl - je .do_brown - cmp $78, %dl - je .do_brown - cmp $79, %dl - je .do_brown - - jmp pc_loop - - .do_brown: - movb $0x6F, COLOR - jmp pc_loop - - .l_gray: - cmp $75, %dl - je .do_l_gray - cmp $76, %dl - je .do_l_gray - cmp $77, %dl - je .do_l_gray - cmp $78, %dl - je .do_l_gray - cmp $79, %dl - je .do_l_gray - - jmp pc_loop - - .do_l_gray: - movb $0x7F, COLOR - jmp pc_loop - - .d_gray: - cmp $75, %dl - je .do_d_gray - cmp $76, %dl - je .do_d_gray - cmp $77, %dl - je .do_d_gray - cmp $78, %dl - je .do_d_gray - cmp $79, %dl - je .do_d_gray - - jmp pc_loop - - .do_d_gray: - movb $0x8F, COLOR - jmp pc_loop - - .l_blue: - cmp $75, %dl - je .do_l_blue - cmp $76, %dl - je .do_l_blue - cmp $77, %dl - je .do_l_blue - cmp $78, %dl - je .do_l_blue - cmp $79, %dl - je .do_l_blue - - jmp pc_loop - - .do_l_blue: - movb $0x9F, COLOR - jmp pc_loop - - .l_green: - cmp $75, %dl - je .do_l_green - cmp $76, %dl - je .do_l_green - cmp $77, %dl - je .do_l_green - cmp $78, %dl - je .do_l_green - cmp $79, %dl - je .do_l_green - - jmp pc_loop - - .do_l_green: - movb $0xAF, COLOR - jmp pc_loop - - .l_cyan: - cmp $75, %dl - je .do_l_cyan - cmp $76, %dl - je .do_l_cyan - cmp $77, %dl - je .do_l_cyan - cmp $78, %dl - je .do_l_cyan - cmp $79, %dl - je .do_l_cyan - - jmp pc_loop - - .do_l_cyan: - movb $0xBF, COLOR - jmp pc_loop - - .l_red: - cmp $75, %dl - je .do_l_red - cmp $76, %dl - je .do_l_red - cmp $77, %dl - je .do_l_red - cmp $78, %dl - je .do_l_red - cmp $79, %dl - je .do_l_red - - jmp pc_loop - - .do_l_red: - movb $0xCF, COLOR - jmp pc_loop - - .l_mag: - cmp $75, %dl - je .do_l_mag - cmp $76, %dl - je .do_l_mag - cmp $77, %dl - je .do_l_mag - cmp $78, %dl - je .do_l_mag - cmp $79, %dl - je .do_l_mag - - jmp pc_loop - - .do_l_mag: - movb $0xDF, COLOR - jmp pc_loop - - .yellow: - cmp $75, %dl - je .do_yellow - cmp $76, %dl - je .do_yellow - cmp $77, %dl - je .do_yellow - cmp $78, %dl - je .do_yellow - cmp $79, %dl - je .do_yellow - - jmp pc_loop - - .do_yellow: - movb $0xEF, COLOR - jmp pc_loop - - .white: - cmp $75, %dl - je .do_white - cmp $76, %dl - je .do_white - cmp $77, %dl - je .do_white - cmp $78, %dl - je .do_white - cmp $79, %dl - je .do_white - - jmp pc_loop - - .do_white: - movb $0xF0, COLOR - jmp pc_loop - - # - # Shading / "transparency" - # - .shade0: - cmp $75, %dl - je .do_s0 - cmp $76, %dl - je .do_s0 - cmp $77, %dl - je .do_s0 - cmp $78, %dl - je .do_s0 - cmp $79, %dl - je .do_s0 - - jmp pc_loop - - .do_s0: - movb $0x20, TRANS - jmp pc_loop - - .shade1: - cmp $75, %dl - je .do_s1 - cmp $76, %dl - je .do_s1 - cmp $77, %dl - je .do_s1 - cmp $78, %dl - je .do_s1 - cmp $79, %dl - je .do_s1 - - jmp pc_loop - - .do_s1: - movb $0xB2, TRANS - jmp pc_loop - - - .shade2: - cmp $75, %dl - je .do_s2 - cmp $76, %dl - je .do_s2 - cmp $77, %dl - je .do_s2 - cmp $78, %dl - je .do_s2 - cmp $79, %dl - je .do_s2 - - jmp pc_loop - - .do_s2: - movb $0xB1, TRANS - jmp pc_loop - - .shade3: - cmp $75, %dl - je .do_s3 - cmp $76, %dl - je .do_s3 - cmp $77, %dl - je .do_s3 - cmp $78, %dl - je .do_s3 - cmp $79, %dl - je .do_s3 - - jmp pc_loop - - .do_s3: - movb $0xB0, TRANS - jmp pc_loop - - # New canvas - .news: - cmp $75, %dl - je .new - cmp $76, %dl - je .new - cmp $77, %dl - je .new - cmp $78, %dl - je .new - cmp $79, %dl - je .new - - jmp pc_loop - - cli - hlt - - .section .data - COLOR: .byte 0x00 # Color - TRANS: .byte 0x00 # Transparency diff --git a/kernel/pinb/dstat/dstat.S b/kernel/pinb/dstat/dstat.S deleted file mode 100644 index ffc540b..0000000 --- a/kernel/pinb/dstat/dstat.S +++ /dev/null @@ -1,119 +0,0 @@ - - .code16 - .section .text.pinb.app - .global _dstat - - _dstat: - - .dtitle: - mov $0x02, %ah - mov $17, %dh - mov $0x01, %dl - int $0x10 - - mov $0x09, %ah - mov $0x20, %al - mov $0x00, %bh - mov $0xF1, %bl - mov $66, %cx - int $0x10 - - mov $_d_title, %si - call _printk - - .backg: - mov $0x02, %ah - mov $17, %dh - mov $0x01, %dl - int $0x10 - - .left: - cmp $24, %dh - je .i1 - - mov $0x02, %ah - inc %dh - mov $0x01, %dl - int $0x10 - - mov $0x09, %ah - mov $0xBA, %al - mov $0x00, %bh - mov $0xF1, %bl - mov $1, %cx - int $0x10 - - jmp .left - - .i1: - mov $0x02, %ah - mov $17, %dh - mov $0x01, %dl - int $0x10 - - .right: - cmp $24, %dh - je .bot - - mov $0x02, %ah - inc %dh - mov $66, %dl - int $0x10 - - mov $0x09, %ah - mov $0xBA, %al - mov $0x00, %bh - mov $0xF1, %bl - mov $1, %cx - int $0x10 - - jmp .right - - .bot: - mov $0x02, %ah - mov $01, %dl - int $0x10 - - mov $0x09, %ah - mov $0xCD, %al - mov $0x00, %bh - mov $0xF1, %bl - mov $66, %cx - int $0x10 - - mov $0x0e, %ah - mov $0xC8, %al - int $0x10 - - mov $0x02, %ah - mov $66, %dl - int $0x10 - mov $0x0e, %ah - mov $0xBC, %al - int $0x10 - .halt: - - mov $0x02, %ah - mov $19, %dh - mov $02, %dl - int $0x10 - - xor %dx, %dx - xor %ax, %ax - call _disk_status - - call bbfs_get_params - - mov $0x02, %ah - mov $17, %dh - mov $0x01, %dl - int $0x10 - - .done: - jmp _disk_curs - - .section .rodata.pinb - _d_title: .asciz " \xB3\xFE\xB3 Disk status " - - _d_label: .asciz "Disk label: " - _d_fs_id: .asciz "File system id: " diff --git a/kernel/pinb/home.S b/kernel/pinb/home.S deleted file mode 100644 index 3b03087..0000000 --- a/kernel/pinb/home.S +++ /dev/null @@ -1,434 +0,0 @@ - - .code16 - .section .text.pinb - .global _home - - _home: - mov $0x02, %ah - mov $02, %dh - mov $01, %dl - int $0x10 - - .h_set: - mov $0x02, %ah - inc %dh - mov $01, %dl - int $0x10 - - mov $0x09, %ah - mov $0x20, %al - mov $0x00, %bh - mov $0x1F, %bl - mov $50, %cx - int $0x10 - - cmp $18, %dh - je .h_title - - jmp .h_set - - .h_title: - mov $0x02, %ah - mov $02, %dh - mov $01, %dl - int $0x10 - - mov $0x09, %ah - mov $0x20, %al - mov $0x00, %bh - mov $0xF1, %bl - mov $50, %cx - int $0x10 - - mov $_h_action, %si - call _printk - - mov $_disk_label,%si - call _printk - - .h_border: - - mov $0x02, %ah - mov $02, %dh - mov $01, %dl - int $0x10 - - .hb_left: - mov $0x02, %ah - inc %dh - mov $01, %dl - int $0x10 - - mov $0x09, %ah - mov $0xBA, %al - mov $0x00, %bh - mov $0xF1, %bl - mov $01, %cx - int $0x10 - - cmp $16, %dh - je .hb_i1 - - jmp .hb_left - - .hb_i1: - mov $0x02, %ah - mov $02, %dh - mov $01, %dl - int $0x10 - - .hb_right: - mov $0x02, %ah - inc %dh - mov $50, %dl - int $0x10 - - mov $0x09, %ah - mov $0xBA, %al - mov $0x00, %bh - mov $0xF1, %bl - mov $01, %cx - int $0x10 - - cmp $16, %dh - je .hb_bottom - - jmp .hb_right - - .hb_bottom: - mov $0x02, %ah - mov $01, %dl - int $0x10 - - mov $0x09, %ah - mov $0xCD, %al - mov $0x00, %bh - mov $0xF1, %bl - mov $50, %cx - int $0x10 - - mov $0x0e, %ah - mov $0xC8, %al - int $0x10 - - mov $0x02, %ah - mov $50, %dl - int $0x10 - mov $0x0e, %ah - mov $0xBC, %al - int $0x10 - - .h_icons: - .shell: - mov $0x02, %ah - mov $03, %dh - mov $03, %dl - int $0x10 - mov $_h_shell_1,%si - call _printk - - mov $0x02, %ah - mov $04, %dh - mov $03, %dl - int $0x10 - mov $_h_shell_2,%si - call _printk - - mov $0x02, %ah - mov $05, %dh - mov $03, %dl - int $0x10 - mov $_h_shell_3,%si - call _printk - - mov $0x02, %ah - mov $06, %dh - mov $03, %dl - int $0x10 - mov $_h_shell_4,%si - call _printk - - .paint: - mov $0x02, %ah - mov $03, %dh - mov $0x0C, %dl - int $0x10 - mov $_h_paint_1,%si - call _printk - - mov $0x02, %ah - mov $04, %dh - mov $0x0C, %dl - int $0x10 - mov $_h_paint_2,%si - call _printk - - mov $0x02, %ah - mov $05, %dh - mov $0x0C, %dl - int $0x10 - mov $_h_paint_3,%si - call _printk - - mov $0x02, %ah - mov $06, %dh - mov $0x0C, %dl - int $0x10 - mov $_h_paint_4,%si - call _printk - - mov $0x02, %ah - mov $07, %dh - mov $0x0C, %dl - int $0x10 - mov $_h_paint_5,%si - call _printk - - .notes: - mov $0x02, %ah - mov $03, %dh - mov $0x13, %dl - int $0x10 - mov $_h_notes_1,%si - call _printk - - mov $0x02, %ah - mov $04, %dh - mov $0x13, %dl - int $0x10 - mov $_h_notes_2,%si - call _printk - - mov $0x02, %ah - mov $05, %dh - mov $0x13, %dl - int $0x10 - mov $_h_notes_3,%si - call _printk - - mov $0x02, %ah - mov $06, %dh - mov $0x13, %dl - int $0x10 - mov $_h_notes_4,%si - call _printk - - mov $0x02, %ah - mov $07, %dh - mov $0x13, %dl - int $0x10 - mov $_h_notes_5,%si - call _printk - - .settings: - mov $0x02, %ah - mov $03, %dh - mov $0x1A, %dl - int $0x10 - mov $_h_setin_1,%si - call _printk - - mov $0x02, %ah - mov $04, %dh - mov $0x1A, %dl - int $0x10 - mov $_h_setin_2,%si - call _printk - - mov $0x02, %ah - mov $05, %dh - mov $0x1A, %dl - int $0x10 - mov $_h_setin_3,%si - call _printk - - mov $0x02, %ah - mov $06, %dh - mov $0x1A, %dl - int $0x10 - mov $_h_setin_4,%si - call _printk - - mov $0x02, %ah - mov $07, %dh - mov $0x1A, %dl - int $0x10 - mov $_h_setin_5,%si - call _printk - - .dstat: - mov $0x02, %ah - mov $03, %dh - mov $0x24, %dl - int $0x10 - mov $_h_dstat_1,%si - call _printk - - mov $0x02, %ah - mov $04, %dh - mov $0x24, %dl - int $0x10 - mov $_h_dstat_2,%si - call _printk - - mov $0x02, %ah - mov $05, %dh - mov $0x24, %dl - int $0x10 - mov $_h_dstat_3,%si - call _printk - - mov $0x02, %ah - mov $06, %dh - mov $0x24, %dl - int $0x10 - mov $_h_dstat_4,%si - call _printk - - mov $0x02, %ah - mov $07, %dh - mov $0x24, %dl - int $0x10 - mov $_h_dstat_5,%si - call _printk - - .loada: - mov $0x02, %ah - mov $0x9, %dh - mov $0x03, %dl - int $0x10 - mov $_loada_1,%si - call _printk - - mov $0x02, %ah - mov $0xA, %dh - mov $0x03, %dl - int $0x10 - mov $_loada_2,%si - call _printk - - mov $0x02, %ah - mov $0xB, %dh - mov $0x03, %dl - int $0x10 - mov $_loada_3,%si - call _printk - - mov $0x02, %ah - mov $0xC, %dh - mov $0x03, %dl - int $0x10 - mov $_loada_4,%si - call _printk - - mov $0x02, %ah - mov $0xD, %dh - mov $0x03, %dl - int $0x10 - mov $_disk_label,%si - call _printk - - #mov $_loada_5, %si - #call _printk - - - .loadb: - mov $0x02, %ah - mov $0x9, %dh - mov $0x0E, %dl - int $0x10 - mov $_loadb_1,%si - call _printk - - mov $0x02, %ah - mov $0xA, %dh - mov $0x0E, %dl - int $0x10 - mov $_loadb_2,%si - call _printk - - mov $0x02, %ah - mov $0xB, %dh - mov $0x0E, %dl - int $0x10 - mov $_loadb_3,%si - call _printk - - mov $0x02, %ah - mov $0xC, %dh - mov $0x0E, %dl - int $0x10 - mov $_loadb_4,%si - call _printk - - mov $0x02, %ah - mov $0xD, %dh - mov $0x0E, %dl - int $0x10 - mov $_loadb_5, %si - call _printk - - jmp _home_curs - - .h_halt: - cli - hlt - - .section .rodata.pinb - - # - # Strings - # - _h_action: .asciz " \xB3\xFE\xB3 Home : " - - # - # Icons - # - - # Shell (7x3) - _h_shell_1: .asciz "\xDA\xC4\xC4\xC4\xC4\xC4\xBF" - _h_shell_2: .asciz "\xB3\x3E\x20\x20\x20\x20\xB3" - _h_shell_3: .asciz "\xC0\xC4\xC4\xC4\xC4\xC4\xD9" - _h_shell_4: .asciz " Shell" - - # Paint (5x4) - _h_paint_1: .asciz "\xDA\xC4\xC4\xC4\xBF" - _h_paint_2: .asciz "\xB3\xB2\xB1\xB0\xB3" - _h_paint_3: .asciz "\xB3\xB3\x20\x20\xB3" - _h_paint_4: .asciz "\xC0\xC4\xC4\xC4\xD9" - _h_paint_5: .asciz "Paint" - - # Notes (5x4) - _h_notes_1: .asciz "\xDA\xC4\xC4\xC4\xBF" - _h_notes_2: .asciz "\xB3\xC4\xC4\xC4\xB3" - _h_notes_3: .asciz "\xB3\xC4\xC4\xC4\xB3" - _h_notes_4: .asciz "\xC0\xC4\xC4\xC4\xD9" - _h_notes_5: .asciz "Notes" - - # Blank (8x4) - _h_setin_1: .asciz "\xDA\xC4\xC4\xC4\xC4\xC4\xC4\xBF" - _h_setin_2: .asciz "\xB3\x20\x20\x20\x20\x20\x20\xB3" - _h_setin_3: .asciz "\xB3\x20\x20\x20\x20\x20\x20\xB3" - _h_setin_4: .asciz "\xC0\xC4\xC4\xC4\xC4\xC4\xC4\xD9" - _h_setin_5: .asciz " Blank" - - # Disk status (8x4) - _h_dstat_1: .asciz "" - _h_dstat_2: .asciz "\xDA\xC4\xC4\xC4\xC4\xC4\x3F\xBF" - _h_dstat_3: .asciz "\xB3\x20\xC4\xCD\xCD\xC4\x20\xB3" - _h_dstat_4: .asciz "\xC0\xC4\xC4\xC4\xC4\xC4\xC4\xD9" - _h_dstat_5: .asciz "Dsk Stat" - - # LOAD A - _loada_1: .asciz "" - _loada_2: .asciz "\xDA\xC4\xC4\xC4\xC4\xC4\x41\xBF" - _loada_3: .asciz "\xB3\x20\xC4\xCD\xCD\xC4\x20\xB3" - _loada_4: .asciz "\xC0\xC4\xC4\xC4\xC4\xC4\xC4\xD9" - _loada_5: .asciz " Disk A" - - # LOAD B - _loadb_1: .asciz "" - _loadb_2: .asciz "\xDA\xC4\xC4\xC4\xC4\xC4\x42\xBF" - _loadb_3: .asciz "\xB3\x20\xC4\xCD\xCD\xC4\x20\xB3" - _loadb_4: .asciz "\xC0\xC4\xC4\xC4\xC4\xC4\xC4\xD9" - _loadb_5: .asciz " Disk B" diff --git a/kernel/pinb/notes/notes.S b/kernel/pinb/notes/notes.S deleted file mode 100644 index c429de7..0000000 --- a/kernel/pinb/notes/notes.S +++ /dev/null @@ -1,67 +0,0 @@ - .code16 - .section .text.pinb.app - .global _notes - - _notes: - mov $0x02, %ah - mov $0x00, %dx - int $0x10 - - mov $0x09, %ah - mov $0x20, %al - mov $0x00, %bh - mov $0x1E, %bl - mov $2240, %cx - int $0x10 - - mov $0x09, %ah - mov $0x20, %al - mov $0x00, %bh - mov $0xF1, %bl - mov $80, %cx - int $0x10 - - mov $titlew,%si - call _printk - - mov $0x02, %ah - inc %dh - mov $0x00, %dl - int $0x10 - - .textin: - .textinl: - mov $0x00, %ah - int $0x16 - - cmp $0x0D, %al - je .return - - cmpb %al, exitk - je _pinb - - mov $0x0e, %ah - int $0x10 - - jmp .textinl - - .return: - mov $0x0e, %ah - mov $0x0d, %al - int $0x10 - - mov $0x0a, %al - int $0x10 - - mov $0x09, %ah - mov $0x20, %al - mov $0x00, %bh - mov $0x1E, %bl - mov $80, %cx - int $0x10 - - jmp .textin - - .section .rodata.pinb - titlew: .asciz " Write 2.5.0 \xB3 ESC to exit \xB3 Yes this was copied from OS/1 3.0.0 \xB3" - exitk: .byte 27 \ No newline at end of file diff --git a/kernel/pinb/paint/paint.S b/kernel/pinb/paint/paint.S deleted file mode 100644 index ee49b54..0000000 --- a/kernel/pinb/paint/paint.S +++ /dev/null @@ -1,523 +0,0 @@ - - .code16 - .section .text.pinb.app - .global _paint - - _paint: - .screen: - call _clear - mov $0x09, %ah - mov $0x20, %al - mov $0x00, %bh - mov $0x1F, %bl - mov $2240, %cx - int $0x10 - - .topb: - mov $0x09, %ah - mov $0x20, %al - mov $0x00, %bh - mov $0xF1, %bl - mov $80, %cx - int $0x10 - - mov $_paint_title, %si - call _printk - - mov $0x02, %ah - mov $0x02, %dh - mov $0x01, %dl - int $0x10 - - .canvas: - cmp $27, %dh - je .sidebar - - mov $0x09, %ah - mov $0x20, %al - mov $0x00, %bh - mov $0xF0, %bl - mov $72, %cx - int $0x10 - - mov $0x02, %ah - inc %dh - mov $0x01, %dl - int $0x10 - - jmp .canvas - - .sidebar: - - mov $0x02, %ah - mov $0x01, %dh - mov $0x01, %dl - int $0x10 - - .sb1: - mov $0x02, %ah - inc %dh - mov $74, %dl - int $0x10 - - cmp $27, %dh - je .sb2 - - mov $0x09, %ah - mov $0xBA, %al - mov $0x00, %bh - mov $0xF0, %bl - mov $1, %cx - int $0x10 - - jmp .sb1 - - .sb2: - mov $0x02, %ah - inc %dh - mov $75, %dl - int $0x10 - - cmp $27, %dh - je .sb3 - - mov $0x09, %ah - mov $0x20, %al - mov $0x00, %bh - mov $0xF0, %bl - mov $1, %cx - int $0x10 - - jmp .sb2 - - .sb3: - mov $0x02, %ah - inc %dh - mov $76, %dl - int $0x10 - - cmp $27, %dh - je .sb4 - - mov $0x09, %ah - mov $0x20, %al - mov $0x00, %bh - mov $0xF0, %bl - mov $1, %cx - int $0x10 - - jmp .sb3 - - .sb4: - mov $0x02, %ah - inc %dh - mov $77, %dl - int $0x10 - - cmp $27, %dh - je .sb5 - - mov $0x09, %ah - mov $0x20, %al - mov $0x00, %bh - mov $0xF0, %bl - mov $1, %cx - int $0x10 - - jmp .sb4 - - .sb5: - mov $0x02, %ah - inc %dh - mov $78, %dl - int $0x10 - - cmp $27, %dh - je .sb6 - - mov $0x09, %ah - mov $0x20, %al - mov $0x00, %bh - mov $0xF0, %bl - mov $1, %cx - int $0x10 - - jmp .sb5 - - .sb6: - mov $0x02, %ah - inc %dh - mov $79, %dl - int $0x10 - - cmp $27, %dh - je .tb1 - - mov $0x09, %ah - mov $0x20, %al - mov $0x00, %bh - mov $0xF0, %bl - mov $1, %cx - int $0x10 - - jmp .sb6 - - .tb1: - mov $0x02, %ah - mov $01, %dh - mov $00, %dl - int $0x10 - - mov $0x09, %ah - mov $0x20, %al - mov $0x00, %bh - mov $0x1F, %bl - mov $80, %cx - int $0x10 - - mov $0x02, %ah - mov $02, %dh - mov $75, %dl - int $0x10 - - mov $0x09, %ah - mov $0xCD, %al - mov $0x00, %bh - mov $0xF0, %bl - mov $5, %cx - int $0x10 - - mov $0x02, %ah - mov $02, %dh - mov $74, %dl - int $0x10 - - mov $0x0e, %ah - mov $0xC9, %al - int $0x10 - - .bb1: - mov $0x02, %ah - mov $26, %dh - mov $75, %dl - int $0x10 - - mov $0x09, %ah - mov $0xCD, %al - mov $0x00, %bh - mov $0xF0, %bl - mov $5, %cx - int $0x10 - - mov $0x02, %ah - mov $26, %dh - mov $74, %dl - int $0x10 - - mov $0x0e, %ah - mov $0xC8, %al - int $0x10 - - .ico: - .black: - mov $0x02, %ah - mov $0x03, %dh - mov $75, %dl - int $0x10 - - mov $0x09, %ah - mov $0x20, %al - mov $0x00, %bh - mov $0x0F, %bl - mov $5, %cx - int $0x10 - .blue: - mov $0x02, %ah - inc %dh - mov $75, %dl - int $0x10 - - mov $0x09, %ah - mov $0x20, %al - mov $0x00, %bh - mov $0x1F, %bl - mov $5, %cx - int $0x10 - .green: - mov $0x02, %ah - inc %dh - mov $75, %dl - int $0x10 - - mov $0x09, %ah - mov $0x20, %al - mov $0x00, %bh - mov $0x2F, %bl - mov $5, %cx - int $0x10 - .cyan: - mov $0x02, %ah - inc %dh - mov $75, %dl - int $0x10 - - mov $0x09, %ah - mov $0x20, %al - mov $0x00, %bh - mov $0x3F, %bl - mov $5, %cx - int $0x10 - .red: - mov $0x02, %ah - inc %dh - mov $75, %dl - int $0x10 - - mov $0x09, %ah - mov $0x20, %al - mov $0x00, %bh - mov $0x4F, %bl - mov $5, %cx - int $0x10 - .magenta: - mov $0x02, %ah - inc %dh - mov $75, %dl - int $0x10 - - mov $0x09, %ah - mov $0x20, %al - mov $0x00, %bh - mov $0x5F, %bl - mov $5, %cx - int $0x10 - .brown: - mov $0x02, %ah - inc %dh - mov $75, %dl - int $0x10 - - mov $0x09, %ah - mov $0x20, %al - mov $0x00, %bh - mov $0x6F, %bl - mov $5, %cx - int $0x10 - .l_gray: - mov $0x02, %ah - inc %dh - mov $75, %dl - int $0x10 - - mov $0x09, %ah - mov $0x20, %al - mov $0x00, %bh - mov $0x7F, %bl - mov $5, %cx - int $0x10 - .d_gray: - mov $0x02, %ah - inc %dh - mov $75, %dl - int $0x10 - - mov $0x09, %ah - mov $0x20, %al - mov $0x00, %bh - mov $0x8F, %bl - mov $5, %cx - int $0x10 - .l_blue: - mov $0x02, %ah - inc %dh - mov $75, %dl - int $0x10 - - mov $0x09, %ah - mov $0x20, %al - mov $0x00, %bh - mov $0x9F, %bl - mov $5, %cx - int $0x10 - .l_green: - mov $0x02, %ah - inc %dh - mov $75, %dl - int $0x10 - - mov $0x09, %ah - mov $0x20, %al - mov $0x00, %bh - mov $0xAF, %bl - mov $5, %cx - int $0x10 - .l_cyan: - mov $0x02, %ah - inc %dh - mov $75, %dl - int $0x10 - - mov $0x09, %ah - mov $0x20, %al - mov $0x00, %bh - mov $0xBF, %bl - mov $5, %cx - int $0x10 - .l_red: - mov $0x02, %ah - inc %dh - mov $75, %dl - int $0x10 - - mov $0x09, %ah - mov $0x20, %al - mov $0x00, %bh - mov $0xCF, %bl - mov $5, %cx - int $0x10 - .l_mag: - mov $0x02, %ah - inc %dh - mov $75, %dl - int $0x10 - - mov $0x09, %ah - mov $0x20, %al - mov $0x00, %bh - mov $0xDF, %bl - mov $5, %cx - int $0x10 - .yellow: - mov $0x02, %ah - inc %dh - mov $75, %dl - int $0x10 - - mov $0x09, %ah - mov $0x20, %al - mov $0x00, %bh - mov $0xEF, %bl - mov $5, %cx - int $0x10 - .white: - mov $0x02, %ah - inc %dh - mov $75, %dl - int $0x10 - - mov $0x09, %ah - mov $0x20, %al - mov $0x00, %bh - mov $0xF0, %bl - mov $5, %cx - int $0x10 - - mov $0x02, %ah - inc %dh - mov $74, %dl - int $0x10 - - mov $0x09, %ah - mov $0xCD, %al - mov $0x00, %bh - mov $0xF0, %bl - mov $6, %cx - int $0x10 - - mov $0x0e, %ah - mov $0xCC, %al - int $0x10 - - .shade0: - mov $0x02, %ah - inc %dh - mov $75, %dl - int $0x10 - - mov $0x09, %ah - mov $0xDB, %al - mov $0x00, %bh - mov $0xF0, %bl - mov $5, %cx - int $0x10 - - .shade1: - mov $0x02, %ah - inc %dh - mov $75, %dl - int $0x10 - - mov $0x09, %ah - mov $0xB2, %al - mov $0x00, %bh - mov $0xF0, %bl - mov $5, %cx - int $0x10 - - .shade2: - mov $0x02, %ah - inc %dh - mov $75, %dl - int $0x10 - - mov $0x09, %ah - mov $0xB1, %al - mov $0x00, %bh - mov $0xF0, %bl - mov $5, %cx - int $0x10 - - .shade3: - mov $0x02, %ah - inc %dh - mov $75, %dl - int $0x10 - - mov $0x09, %ah - mov $0xB0, %al - mov $0x00, %bh - mov $0xF0, %bl - mov $5, %cx - int $0x10 - - mov $0x02, %ah - inc %dh - mov $74, %dl - int $0x10 - - mov $0x09, %ah - mov $0xCD, %al - mov $0x00, %bh - mov $0xF0, %bl - mov $6, %cx - int $0x10 - - mov $0x0e, %ah - mov $0xCC, %al - int $0x10 - - .new: - mov $0x02, %ah - inc %dh - mov $76, %dl - int $0x10 - - mov $0x0e, %ah - mov $0x4E, %al - int $0x10 - - mov $0x65, %al - int $0x10 - - mov $0x77, %al - int $0x10 - - .halt: - - jmp _paint_curs - - cli - hlt - - .section .rodata.pinb.app - _paint_title: .asciz " \xB3\xFE\xB3 Paint v5.0.0" diff --git a/kernel/pinb/pinb.S b/kernel/pinb/pinb.S deleted file mode 100644 index de4f082..0000000 --- a/kernel/pinb/pinb.S +++ /dev/null @@ -1,55 +0,0 @@ - .code16 - .section .text.pinb - .global _pinb - - .extern _shell - - _pinb: - .start: - call _clear - mov $_pm_0, %si - call _printk - - .screen: - call _clear - - mov $0x09, %ah - mov $0x20, %al - mov $0x00, %bh - mov $0x1F, %bl - mov $2240, %cx - int $0x10 - - .t_bar: - mov $0x02, %ah - mov $00, %dh - mov $00, %dl - int $0x10 - - mov $0x09, %ah - mov $0x20, %al - mov $0x00, %bh - mov $0xF1, %bl - mov $80, %cx - int $0x10 - - mov $_bar, %si - call _printk - - .bt_str: - mov $0x02, %ah - mov $27, %dh - mov $44, %dl - int $0x10 - mov $_pm_0, %si - call _printk - - .end: - jmp _desk_curs - - cli - hlt - - .section .rodata.pinb - _pm_0: .asciz " Pinboard Enviroment for OS/1 v5.x" - _bar: .asciz " \xB3 Home \xB3 \xB3 About \xB3" diff --git a/kernel/pinb/prod/p_wnd.S b/kernel/pinb/prod/p_wnd.S deleted file mode 100644 index 0e7eef0..0000000 --- a/kernel/pinb/prod/p_wnd.S +++ /dev/null @@ -1,157 +0,0 @@ - .code16 - .section .text.pinb - .global _prod - - _prod: - .o_title: - mov $0x02, %ah - mov $02, %dh - mov $52, %dl - int $0x10 - - mov $0x09, %ah - mov $0x20, %al - mov $0x00, %bh - mov $0xF1, %bl - mov $21, %cx - int $0x10 - - mov $_o_title, %si - call _printk - - .border: - - mov $0x02, %ah - mov $02, %dh - mov $52, %dl - int $0x10 - - .left: - mov $0x02, %ah - inc %dh - mov $52, %dl - int $0x10 - - mov $0x09, %ah - mov $0xBA, %al - mov $0x00, %bh - mov $0xF1, %bl - mov $01, %cx - int $0x10 - - cmp $10, %dh - je .int1 - - jmp .left - - .int1: - mov $0x02, %ah - mov $02, %dh - mov $01, %dl - int $0x10 - - .right: - mov $0x02, %ah - inc %dh - mov $72, %dl - int $0x10 - - mov $0x09, %ah - mov $0xBA, %al - mov $0x00, %bh - mov $0xF1, %bl - mov $01, %cx - int $0x10 - - cmp $10, %dh - je .bottom - - jmp .right - - .bottom: - mov $0x02, %ah - mov $52, %dl - int $0x10 - - mov $0x09, %ah - mov $0xCD, %al - mov $0x00, %bh - mov $0xF1, %bl - mov $20, %cx - int $0x10 - - mov $0x0e, %ah - mov $0xC8, %al - int $0x10 - - mov $0x02, %ah - mov $72, %dl - int $0x10 - mov $0x0e, %ah - mov $0xBC, %al - int $0x10 - - .icons: - mov $0x02, %ah - mov $02, %dh - mov $52, %dl - int $0x10 - - .words: - mov $0x02, %ah - inc %dh - mov $55, %dl - int $0x10 - mov $_words_1, %si - call _printk - - mov $0x02, %ah - inc %dh - mov $55, %dl - int $0x10 - mov $_words_2, %si - call _printk - - mov $0x02, %ah - inc %dh - mov $55, %dl - int $0x10 - mov $_words_3, %si - call _printk - - mov $0x02, %ah - inc %dh - mov $55, %dl - int $0x10 - mov $_words_4, %si - call _printk - - mov $0x02, %ah - inc %dh - mov $55, %dl - int $0x10 - mov $_words_5, %si - call _printk - - mov $0x02, %ah - inc %dh - mov $55, %dl - int $0x10 - mov $_words_6, %si - call _printk - cli - hlt - - .section .rodata.pinb - _o_title: .asciz " \xB3\xFE\xB3 Home\\Office" - - # - # Icon(s) - # - - _words_1: .asciz "\xD6\xC4\xC4\xC4\xC4\xC4\xBF" - _words_2: .asciz "\xBA\x20\xC4\xC4\xC4\x20\xB3" - _words_3: .asciz "\xBA\xCD\xCD\xCD\xCD\xCD\xB3" - _words_4: .asciz "\xBA\xCD\xCD\xCD\xCD\xCD\xB3" - _words_5: .asciz "\xD3\xC4\xC4\xC4\xC4\xC4\xD9" - _words_6: .asciz " Words " diff --git a/kernel/pinb/prod/words.S b/kernel/pinb/prod/words.S deleted file mode 100644 index 99222bd..0000000 --- a/kernel/pinb/prod/words.S +++ /dev/null @@ -1,10 +0,0 @@ - - .code16 - .section .text.pinb.app - .global _words - - _words: - call _clear - - cli - hlt diff --git a/kernel/pinb/sets/stng.S b/kernel/pinb/sets/stng.S deleted file mode 100644 index 92382e6..0000000 --- a/kernel/pinb/sets/stng.S +++ /dev/null @@ -1,97 +0,0 @@ - - .code16 - .section .text.pinb.app - .global _settings - - _settings: - - .screen: - call _clear - - mov $0x09, %ah - mov $0x20, %al - mov $0x00, %bh - mov $0x1F, %bl - mov $2240, %cx - int $0x10 - - .topb: - mov $0x09, %ah - mov $0x20, %al - mov $0x00, %bh - mov $0xF1, %bl - mov $80, %cx - int $0x10 - - mov $_s_title, %si - call _printk - - mov $0x02, %ah - mov $0x02, %dh - mov $0x01, %dl - int $0x10 - - .fill: - cmp $27, %dh - je .prev_win - - mov $0x09, %ah - mov $0x20, %al - mov $0x00, %bh - mov $0xF0, %bl - mov $78, %cx - int $0x10 - - mov $0x02, %ah - inc %dh - mov $0x01, %dl - int $0x10 - - jmp .fill - - .prev_win: - mov $0x02, %ah - mov $0x02, %dh - mov $30, %dl - int $0x10 - - .pw_loop: - cmp $14, %dh - je .items - - mov $0x02, %ah - inc %dh - mov $37, %dl - int $0x10 - - mov $0x09, %ah - mov $0x20, %al - mov $0x00, %bh - mov $0x1F, %bl - mov $40, %cx - int $0x10 - - jmp .pw_loop - - .items: - mov $0x02, %ah - mov $15, %dh - mov $52, %dl - int $0x10 - - mov $_prev, %si - call _printk - - .halt: - - cli - hlt - - .section .rodata.pinb - _s_title: .asciz " \xB3\xFE\xB3 Settings " - - _prev: .asciz " Preview " - - # - # Menu options - # diff --git a/kernel/td/README.txt b/kernel/td/README.txt new file mode 100644 index 0000000..76291f8 --- /dev/null +++ b/kernel/td/README.txt @@ -0,0 +1,6 @@ +The eDitor (td) +=============== + + The eDitor or td for short is a simple full screen + text editor that allows you to edit files. You can + create a new file, or edit an existing file. diff --git a/kernel/td/file.S b/kernel/td/file.S new file mode 100644 index 0000000..151e36a --- /dev/null +++ b/kernel/td/file.S @@ -0,0 +1,54 @@ + + .code16 + .global _td_create_new + .global _td_open_file + .section .text + + _td_create_new: + movb (_cur_drive),%dl + call _mk_file + + movb %ch, (_td_file_track) + + jmp _td_screen_setup + + _td_open_file: + movb (_cur_drive),%dl + call _find_file + jnc _td_file_not_found + + xor %ax, %ax + mov %ax, %ds + + movb %ch, (_td_file_track) + + mov $0x02, %ah + mov $0x12, %al + mov $0xA000,%bx + mov $0x01, %cl + mov $0x00, %dh + movb (_cur_drive),%dl + int $0x13 + + mov $0x02, %ah + mov $0x12, %al + mov $0xC400,%bx + inc %ch + mov $0x01, %cl + mov $0x00, %dh + movb (_cur_drive),%dl + int $0x13 + + jmp _td_screen_setup + + _td_file_not_found: + mov $_td_no_file, %si + call _printk + + int $0x30 + + cli + hlt + + .section .rodata + _td_no_file: .asciz "\r\n\tInputed file not found.\r\n" diff --git a/kernel/td/td.S b/kernel/td/td.S new file mode 100644 index 0000000..1961662 --- /dev/null +++ b/kernel/td/td.S @@ -0,0 +1,585 @@ + +/* + * td.S --- The eDitor + * --------------------------------- + * + * The eDitor or td for short is a very + * simple text editor for OS/1 v6.0.0. + * + * It doesn't do much, you can just + * edit existing or create and edit new + * files. + * + * As of now it is very bare bones but + * I do plan to flesh it out a bit more + * so rather than it being a gray on + * black screen that also happens to be + * able to save files to the disk I + * plan to make it more like edit on + * MS-DOS. + * + * Do note that td is a bit (read: very + * much) buggy, and if you are not care- + * full it could corrupt the disk. + * + * --------------------------------- + * + * Controls: + * CTRL + S => save file + * CTRL + Q => quit + * + * LEFT CUR. KEY => move to left + * RIGHT CUR. KEY => move to right + * UP CUR. KEY => move up + * DOWN CUR. KEY => move down + * + * PAGE DOWN => show next page + * + * --------------------------------- + */ + + .code16 + .global _td + .global _td_screen_setup + .global _td_main + .section .text + + # + # Entry point + # + _td: + + # + # Input prompts + # + _td_input_prompt: + mov $_prompt_0, %si + call _printk + + # create a new file or + # open an existing one + 1: + mov $_prompt_1, %si + call _printk + + # user input [n/o] + _td_new_or_open: + xor %ax, %ax + int $0x16 + + cmp $0x6E, %al + je new + + cmp $0x6F, %al + je open + + jmp _td_new_or_open + + # user chose new + new: + mov $0x0e, %ah + int $0x10 + + mov $0x01, _td_is_new + + jmp _td_file_name + + # user chose to open + open: + mov $0x0e, %ah + int $0x10 + + mov $0x01, _td_is_open + + jmp _td_file_name + + _td_file_name: + # File name + xor %ax, %ax + xor %bx, %bx + xor %cx, %cx + mov $0x03, %ah + int $0x10 + + push %dx + + mov $_prompt_2, %si + call _printk + + pop %dx + + xor %ax, %ax + xor %bx, %bx + xor %cx, %cx + mov $0x02, %ah + inc %dh + mov $0x20, %dl + int $0x10 + + xor %cx, %cx + mov $_td_file_, %di + + # user input [file name] + _td_fn_loop: + xor %ax, %ax + int $0x16 + + cmp $0x0d, %al + je _td_prompt_end + + mov $0x0e, %ah + int $0x10 + + stosb + inc %cl + jmp _td_fn_loop + + _td_prompt_end: + mov $_td_file_, %si + + cmp $0x01, _td_is_new + je _td_create_new + + cmp $0x01, _td_is_open + je _td_open_file + + # + # incase somehow it doesn't + # jump to those functons, + # halt the pc + # + cli + hlt + + # + # Screen setup + # + _td_screen_setup: + # clear scr. + mov $0x03, %ax + int $0x10 + + # Set pallete register + mov $0x1003, %ax + mov $0x00, %bl + int $0x10 + + # Set up the font + mov $0x11, %ah + mov $0x11, %al + int $0x10 + + # if there is any buffer + # print it out (0xA000) + mov $0xA010, %bx + mov $2080, %cx + + _td_bout_loop: + mov (%bx), %al + mov $0x0e, %ah + int $0x10 + + push %ax + push %bx + push %cx + + xor %ax, %ax + xor %bx, %bx + xor %cx, %cx + + mov $0x03, %ah + int $0x10 + + cmp $0x1B, %dh + je _td_bout_end + + pop %cx + pop %bx + pop %ax + + inc %bx + loop _td_bout_loop + + _td_bout_end: + + # return cursor to 0,0 + xor %ax, %ax + xor %bx, %bx + xor %cx, %cx + + mov $0x02, %ah + mov $0x00, %dh + mov $0x00, %dl + int $0x10 + + xor %cx, %cx + mov $0xA010, %di + + _td_text_input: + movb (%di), %cl + + xor %ax, %ax + int $0x16 + + # text stuff + cmp $0x08, %al + je _td_backspace + + cmp $0x0D, %al + je _td_enter_key + + cmp $0x09, %al + je _td_tab + + # cursor movement + cmpb $0x48, %ah + je _td_up + + cmpb $0x50, %ah + je _td_down + + cmpb $0x4B, %ah + je _td_left + + cmpb $0x4D, %ah + je _td_right + + # control keys + cmpb (_ctrl_s), %al + je _td_ctrl_s + + cmpb (_ctrl_q), %al + je _td_ctrl_q + + # page up + cmpb $0x49, %ah + je _td_page_up + + # page down + cmpb $0x51, %ah + je _td_page_dn + + mov $0x0e, %ah + int $0x10 + + mov %al, (%di) + inc %di + inc %cl + jmp _td_text_input + + _td_backspace: + dec %di + movb $0x0000, (%di) + dec %cl + + mov $0x0e, %ah + mov $0x08, %al + int $0x10 + + mov $0x20, %al + int $0x10 + + mov $0x08, %al + int $0x10 + + jmp _td_text_input + + _td_enter_key: + mov $0x0d, %al + mov %al, (%di) + inc %di + inc %cl + + mov $0x0a, %al + mov %al, (%di) + inc %di + inc %cl + + mov $0x0e, %ah + mov $0x0d, %al + int $0x10 + + mov $0x0a, %al + int $0x10 + + jmp _td_text_input + + _td_tab: + mov $0x20, %al + mov %al, (%di) + mov $0x20, %al + mov %al, (%di) + mov $0x20, %al + mov %al, (%di) + mov $0x20, %al + mov %al, (%di) + + add $0x04, %di + add $0x04, %cl + + mov $0x0e, %ah + mov $0x20, %al + int $0x10 + int $0x10 + int $0x10 + int $0x10 + + jmp _td_text_input + + _td_up: + mov %di, %ax + sub $80, %ax + + mov %ax, %di + + xor %ax, %ax + + mov $0x03, %ah + int $0x10 + + mov $0x02, %ah + dec %dh + int $0x10 + + jmp _td_text_input + + _td_down: + mov %di, %ax + add $80, %ax + + mov %ax, %di + + xor %ax, %ax + + mov $0x03, %ah + int $0x10 + + mov $0x02, %ah + inc %dh + int $0x10 + + jmp _td_text_input + + _td_left: + dec %di + + mov $0x03, %ah + int $0x10 + + mov $0x02, %ah + dec %dl + int $0x10 + + jmp _td_text_input + + _td_right: + inc %di + + mov $0x03, %ah + int $0x10 + + mov $0x02, %ah + inc %dl + int $0x10 + + jmp _td_text_input + + _td_ctrl_s: + xor %ax, %ax + mov %ax, %es + + mov $_td_file_,%si + mov $0xA000,%di + mov $16, %cx + rep movsb + + mov $_td_file_,%si + movb (_cur_drive),%dl + call _find_file + + mov %ch, _td_file_track + + xor %ax, %ax + mov %ax, %es + xor %cx, %cx + + push %dx + + mov $0x03, %ah + mov $0x12, %al + mov $0xA000,%bx + movb (_td_file_track),%ch + mov $0x01, %cl + mov $0x00, %dh + movb (_cur_drive),%dl + int $0x13 + + mov $0x03, %ah + mov $0x12, %al + mov $0xC400,%bx + inc %ch + mov $0x01, %cl + mov $0x00, %dh + movb (_cur_drive),%dl + int $0x13 + + pop %dx + + jmp _td_text_input + + _td_ctrl_q: + # clear scr. + mov $0x03, %ax + int $0x10 + + # Set pallete register + mov $0x1003, %ax + mov $0x00, %bl + int $0x10 + + # Set up the font + mov $0x11, %ah + mov $0x11, %al + int $0x10 + + int $0x30 + + _td_page_up: + # if we are on the first + # page, do nothing + cmp $0xA010, %di + je _td_text_input + + xor %cx, %cx + # update the %di and stuff + sub $2080, %di + + # update the load addrs. + # and print out a page + # from the address + sub $2080, _td_load_addrs + mov $_td_load_addrs,%bx + mov $2080, %cx + + _td_pgup_l: + mov (%bx), %al + mov $0x0e, %ah + int $0x10 + + push %ax + push %bx + push %cx + + xor %ax, %ax + xor %bx, %bx + xor %cx, %cx + + mov $0x03, %ah + int $0x10 + + cmp $0x1B, %dh + je _td_text_input + + pop %cx + pop %bx + pop %ax + + inc %bx + loop _td_pgup_l + + mov $0x02, %ah + xor %dx, %dx + int $0x10 + + jmp _td_text_input + + _td_page_dn: + # if we are on the last + # page, do nothing + cmp $0xE810, %di + je _td_text_input + + xor %cx, %cx + # update the %di and stuff + add $2080, %di + + # update the load addrs. + # and print out a page + # from the address + add $2080, _td_load_addrs + mov $_td_load_addrs,%bx + mov $2080, %cx + + _td_pgdn_l: + mov (%bx), %al + mov $0x0e, %ah + int $0x10 + + push %ax + push %bx + push %cx + + xor %ax, %ax + xor %bx, %bx + xor %cx, %cx + + mov $0x03, %ah + int $0x10 + + cmp $0x1B, %dh + je _td_text_input + + pop %cx + pop %bx + pop %ax + + inc %bx + loop _td_pgdn_l + + xor %dx, %dx + mov $0x02, %ah + mov $0x00, %dh + mov $0x00, %dl + int $0x10 + + jmp _td_text_input + + jmp _td_text_input + + # + # Exit + # + _td_exit: + int $0x30 + + .section .rodata + .global _td_file_track + .global _td_load_addrs + + _td_file_track: .byte 0 + _td_file_sector: .byte 0 + + _td_load_addrs: .word 0xA000 + + # + # COMMAND LINE PROMPTS + # + _prompt_0: .asciz "\t=-=-=-=-= The eDitor v1.0.0 =-=-=-=-=" + _prompt_1: .asciz "\r\n > Create a [n]ew file or [o]pen an existing one? [n/o] " + _prompt_2: .asciz "\r\n > File name (with exstension) [ ]" + + # file input + _td_file_: .fill 17,1,0 + + # + # KEYS + # + _ctrl_s: .byte 0x13 # CTRL + S = save + _ctrl_q: .byte 0x11 # CTRL + Q = quit + + # + # Variables + # + .section .data + _td_is_new: .byte 0 + _td_is_open: .byte 0 diff --git a/utils/make.bbfs b/utils/make.bbfs deleted file mode 100755 index 09132eee7066cbcb445f40672d761b40ee0e791f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 17608 zcmeHPdvILUc|WU%CGcZq$99bE;A^lM8}NEpk{>`ER*w}c@T-!XI40zJwYriPYj?%& zm61G*BO;5UIv(6i3Z6F8x|ufdWF}MhMO)Jl850|rPRBGIh9PO=p(T}K3U*6~n*!V4 zch32)?q2pXw%bYn*`wL}o$ou}>wM?j$GP`A`bunTTSXusxKxVI3Bq>HSCpu3sNJF~ z08z17%*AnqxLM2sUL|R&J*og&Re8Ol7}jcfB_PQyp-Kt3T#*Gs_K+aS`IV`8s)eDb zQ#i?0Q&r<$_{Y={6o%aH*fV6a5FWTd_m81lj#M6Br{s?7_%W>2{T`K0fk*pA>PYUS zmOH8C7}jZf3^|?@6Z&n|dc81;HY!nh6v8VvtmVA0Rr50>8&o>qvU{$_-cBvoxKioy z!c~ea7_zf` zjiG!tR4?1fuP}ZzeD`hNB`QY6B+*ztAOb~rg~q`m3-K<*kHSv!$@DM2x?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x}V`HX4KGY z|7Fn01l!-eQZX|8BQ3|kYyU@RaLa$7x6U+0yv&r?6 zU93^SIkG&%*&ca*zc{7kPdJjQ!g353dgOUseKf52`8;JcEXVj#$P>-+KdM?zX!*T7 zF|>eg)|e10w0+I)&{^Jl{(@Z=H}sg0?JsGCC-sE=45;*ul>O&^5siJ9g8DGLK~=o} Yyn*d9FTMUNCI6Fq6vrBmfCm--19b2NH~;_u diff --git a/utils/make.bbfs.cpp b/utils/make.bbfs.cpp deleted file mode 100644 index ad9940d..0000000 --- a/utils/make.bbfs.cpp +++ /dev/null @@ -1,109 +0,0 @@ - -/** - * Not my proudest C++ code, but hey - * I did not want to play with argv, - * maybe someday. - * - * NOTE: if you don't input 8 chars - * into file sys. id, the app - * will crash. -*/ - -#include -#include -#include -#include - -#include -#include -#include - -#include -#include - -using namespace std; - -int main() -{ - char buffer[512]; - int disk_desc; - - string file; - string disk_label; - int block_size; - int bootable; - string file_sys_id; - - _file: - cout << "File path: "; - getline(cin, file); - - _disk_label: - cout << "Disk label: "; - getline(cin, disk_label); - - if (disk_label.size() > 10) { - fputs("[!!] Disk label cannot be more than 10 chars. in length [!!]\n", stderr); - goto _disk_label; - } - else - goto _bootable; - - _bootable: - cout << "Is the disk bootable (1-yes | 0-no)? "; - cin >> bootable; - - if (bootable != 0 && bootable != 1) { - fputs("[!!] Enter either 1 or 0 [!!]\n", stderr); - goto _bootable; - } - else - goto _file_sys_id; - - _file_sys_id: - cout << "File System id: "; - cin.ignore(); - getline(cin, file_sys_id); - - if (file_sys_id.size() > 8) { - fputs("[!!] File Sys. id string cannot be more than 8 chars. [!!]\n", stderr); - goto _file_sys_id; - } - else - goto _format; - - _format: - - ofstream disk_file(file.c_str(), ios::out); - - if (disk_file.is_open()) - { - memset(buffer, 0x00, sizeof(buffer)); - - for (int x = 3; x <= 13; x++) - buffer[x] = disk_label[x-3]; - - if (bootable == 1) { - buffer[14] = bootable; - buffer[510] = 0x55; - buffer[511] = 0xaa; - } else { - buffer[14] = bootable; - } - - for (int x = 15; x<= 23-1; x++) - buffer[x] = file_sys_id[x-15]; - - for (int i = 0; i < 512; i++) - disk_file << buffer[i]; - - disk_file.close(); - } - - else { - fputs("[!!] Unable to open the file, try again [!!]\n", stderr); - goto _file; - } - - return 0; -} diff --git a/utils/read.bbfs b/utils/read.bbfs deleted file mode 100755 index 204821a737fbaa865138199c8f69b046cab0a28a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15672 zcmeHO4Qw1&5q@{J8z+r@P8z3fLYt+;B`Nq~$Bt!EnVf&lSqJB*u>(~6Y|eM*_{jOr z+^vHXLF&qJ$;mpYl?rX8A_atmR0*l#Co(}n7hIACHON&Z6p2b$kP2Hh#R&zawDmIc z-pqQvwV^@?sc6UAoj2di_ukvtpL=^Zel*1?4ky!kZ2NR zu)j~-EA9ZhSYpZ_QVP6EuKSnjQo@TsBd-b@%jl0NSg__9qDJ0IQoBldSPME1voD~jbos6zi!6kpvSuV>8Uv9;N<@?CY+R%V<0)_g z9zAYE`;Qxakwj7qW)dm0Pap-agGRBptFyJu*csdz+-0{L>{fk)Fgkno8?ksMek_qS zh-V^Cf#-aOT1L+ivZK%*?1BHNV2dPnXq{4yA&jA??pFa-V`FznF zI3F`nJmqD;%Yc^wF9Ti%ybO35_)uryuYvpip^wg$>fW1rH{T?Iw_CK z+VyLIt?HLyAJ`It7TW#jo1L~ms(*<#F8yYwq;BxCd*#b|?hpFtjrl`8;krWIRXyJvhEA-?%@F=pUof!c3{YT#`R2y}(eovz zP<`sQSqW2L2&$>Cwx$DHMlf!YG{iqF<9F>twS7U)&Fh!m+@oK*U8MUi>#r=B8=!-0 z)Iq5=-51!>zR1V-i>tTE-ov-+3i|jMqQ3wDBCbrJ zp1HVSS-G*70oU{Sc~IlhxUc{xK+pXqcV%WAA`}Ql3XCgbFG3uifHxi-m+id%o@(gN z1kOKIg5BuROJ|=dnS$1+4DpR#L{{19Yk~7)3(z_{_B+^L8G8x#0qP6edHv?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4Xoavna^NHJm$t-vtbF!u{LNaeAKfx)nmCxX=G{ zfI9ga@mL>KG<(k<6RdyW;*XGnb)FMLJur_u{Gp4_>ju`mF6Vgn{BfOt^S6i5D3Ub( zhT;@A|L5Rz@*6Z2&6@xJj{9))ue$h0iO(AI>l8kJjJ*nta@gp$wf`T9|4+{y&o=Ad z12^E{^ZUs48UR5!PFagK<8OciuN@wr*O&JHU1D-T@cKt#9-qgz0K*XG^Z!8=c3`v+ z+my2R%xC>Jc$|EGpP3^o;sW$Cq9SqJn?+^`LP->p1XrCD(aP$=Yh!SGGVQ| PJpVg%<7{*hT&DOZ+mfbk diff --git a/utils/read_bbfs.c b/utils/read_bbfs.c deleted file mode 100644 index 804a8f2..0000000 --- a/utils/read_bbfs.c +++ /dev/null @@ -1,65 +0,0 @@ - -#include -#include -#include -#include - -#include -#include -#include - -#define DEV 0 - -typedef struct bbfs_t -{ - char disk_label[8]; - uint8_t block_size; - char reserve[2]; - uint8_t bootable; - char file_sys_id[8]; - -} BBFS_Parmam; - -void read_boot_sector(char *file_path) -{ - char buffer[512]; - int boot_sector; - BBFS_Parmam disk; - - boot_sector = open(file_path, O_RDONLY); - read(boot_sector, buffer, 510); - close(boot_sector); - - for (int x = 3; x <= 13; x++) - disk.disk_label[x-3] = buffer[x]; - - disk.bootable = buffer[14]; - - for (int x = 15; x <= 23-1; x++) - disk.file_sys_id[x-15] = buffer[x]; - - printf("DISK LABEL: %s\n", disk.disk_label); - printf("BOOTABLE: %d\n", disk.bootable); - printf("FILE SYS: %s\n", disk.file_sys_id); - -} - -int main(int argc, char *argv[]) -{ - - #if DEV == 1 - for (int i = 0; i < argc-1; i++) - printf("argc(%d) = argv(%s)\n", i, argv[i]); - #endif - - if (argc < 2) { - - } else { - - } - - read_boot_sector(argv[1]); - - return 0; - -}