Hello:
I want to begin the develop of a SHELL for my new little OS MISIS 1.0.
Where can I get information about the elements that should have any OS Shell?
Or, which are the shell's responsibilities?
Thank you,
Pepito
Shell elements
RE:Shell elements
This is a simple shell for the old v2os.
[code]
[BITS 32] ;Set code generation to 32 bit mode
[ORG 0x0100] ;Set code start address to 0100h
[SEGMENT .text] ;Main code segment
main:
mov ah, 46
call clear_screen
call welcome_msg
jmp disp_prompt
welcome_msg:
mov al, 4
mov edi, welcome_str
int 0x20
ret
disp_prompt:
mov al, 4
mov edi, prompt_str
int 0x20
user_input:
mov al, 40
mov edi, input_str
int 0x20
call upper_case
test_input:
;Begin test for directory command
mov esi, dir_test_str
mov edi, input_str
mov al, 30
int 0x20
test al, al
jz dir_command
;Begin test for reboot command
mov esi, reboot_str
mov edi, input_str
mov al, 30
int 0x20
test al, al
jz reboot_command
;Begin test for exit command
mov esi, exit_str
mov edi, input_str
mov al, 30
int 0x20
test al, al
jz exit
;Begin test for cls command
mov esi, cls_str
mov edi, input_str
mov al, 30
int 0x20
test al, al
jz cls_command
;Begin test for help command
mov esi, help_str
mov edi, input_str
mov al, 30
int 0x20
test al, al
jz help_command
execute_input:
mov al, 4
mov edi, temp_msg
int 0x20
jmp disp_prompt
reboot_command:
mov al, 13
int 0x20
help_command:
mov al, 4
mov edi, help_msg
int 0x20
jmp disp_prompt
cls_command:
mov ah, 46
call clear_screen
jmp disp_prompt
dir_command:
mov al, 25
mov edi, dir
int 0x20
jmp disp_prompt
upper_case:
mov esi, input_str
mov al, 31
int 0x20
ret
clear_screen:
mov al, 4
mov edi, blank
int 0x20
dec ah
jnz clear_screen
ret
exit:
retf
[SEGMENT .data] ;Initialised data segment
prompt_str: db 'A:\>',0
temp_msg: db 'Bad command or file name',13,10,0
dir: db 'files',0
dir_test_str: db 'DIR',0
exit_str: db 'EXIT',0
reboot_str: db 'REBOOT',0
cls_str: db 'CLS',0
help_str: db 'HELP',0
input_str: times 256 db 0
blank: db ' ',13,10,0
;temp_buff: times 255 db 0
welcome_str: db 13,10,'ÛßßßßßßßßßßßßßßßßßßßßÛ',13,10
db 'Û Welcome to V2-DOS. Û',13,10
db 'Û Û',13,10
db 'Û by: Û',13,10
db 'Û Stalin Û',13,10
db 'ÛÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ',13,10,13,10,0
help_msg: db 13,10,'ÛßßßßßßßßßßßßßßßßßßßßßßÛ',13,10
db 'Û dir: list files Û',13,10
db 'Û cls: clear screen Û',13,10
db 'Û exit: exit shell Û',13,10
db 'Û reboot: quick reboot Û',13,10
db 'ÛÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ',13,10,13,10,0
[/code]
It may help ?.
\\\\||////
(@@)
ASHLEY4.
[code]
[BITS 32] ;Set code generation to 32 bit mode
[ORG 0x0100] ;Set code start address to 0100h
[SEGMENT .text] ;Main code segment
main:
mov ah, 46
call clear_screen
call welcome_msg
jmp disp_prompt
welcome_msg:
mov al, 4
mov edi, welcome_str
int 0x20
ret
disp_prompt:
mov al, 4
mov edi, prompt_str
int 0x20
user_input:
mov al, 40
mov edi, input_str
int 0x20
call upper_case
test_input:
;Begin test for directory command
mov esi, dir_test_str
mov edi, input_str
mov al, 30
int 0x20
test al, al
jz dir_command
;Begin test for reboot command
mov esi, reboot_str
mov edi, input_str
mov al, 30
int 0x20
test al, al
jz reboot_command
;Begin test for exit command
mov esi, exit_str
mov edi, input_str
mov al, 30
int 0x20
test al, al
jz exit
;Begin test for cls command
mov esi, cls_str
mov edi, input_str
mov al, 30
int 0x20
test al, al
jz cls_command
;Begin test for help command
mov esi, help_str
mov edi, input_str
mov al, 30
int 0x20
test al, al
jz help_command
execute_input:
mov al, 4
mov edi, temp_msg
int 0x20
jmp disp_prompt
reboot_command:
mov al, 13
int 0x20
help_command:
mov al, 4
mov edi, help_msg
int 0x20
jmp disp_prompt
cls_command:
mov ah, 46
call clear_screen
jmp disp_prompt
dir_command:
mov al, 25
mov edi, dir
int 0x20
jmp disp_prompt
upper_case:
mov esi, input_str
mov al, 31
int 0x20
ret
clear_screen:
mov al, 4
mov edi, blank
int 0x20
dec ah
jnz clear_screen
ret
exit:
retf
[SEGMENT .data] ;Initialised data segment
prompt_str: db 'A:\>',0
temp_msg: db 'Bad command or file name',13,10,0
dir: db 'files',0
dir_test_str: db 'DIR',0
exit_str: db 'EXIT',0
reboot_str: db 'REBOOT',0
cls_str: db 'CLS',0
help_str: db 'HELP',0
input_str: times 256 db 0
blank: db ' ',13,10,0
;temp_buff: times 255 db 0
welcome_str: db 13,10,'ÛßßßßßßßßßßßßßßßßßßßßÛ',13,10
db 'Û Welcome to V2-DOS. Û',13,10
db 'Û Û',13,10
db 'Û by: Û',13,10
db 'Û Stalin Û',13,10
db 'ÛÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ',13,10,13,10,0
help_msg: db 13,10,'ÛßßßßßßßßßßßßßßßßßßßßßßÛ',13,10
db 'Û dir: list files Û',13,10
db 'Û cls: clear screen Û',13,10
db 'Û exit: exit shell Û',13,10
db 'Û reboot: quick reboot Û',13,10
db 'ÛÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ',13,10,13,10,0
[/code]
It may help ?.
\\\\||////
(@@)
ASHLEY4.
RE:Shell elements
Thank you, but I have a little shell yet.
I am looking for information about "Shell theory" (books, articles or web links)
Thank you again,
pepito
I am looking for information about "Shell theory" (books, articles or web links)
Thank you again,
pepito