--- /dev/null
+SHELL DESIGN
+============
+
+The BOS shell should operate at a minimum resolution of 80*25, but prefarably on more.
+It should be tile-able to allow different apps to run in different parts of the window, such
+as a "graphical" file browser might use up all but one line at the bottom for commands.
+
+The mouse or keyboard interrupts will be used to switch between active tile, giving that
+areas program full control. Simulating multitasking to some degree.
+
+The built in scripting language needs support to set up screen resolution, tile areas,
+and more on boot.
+
+Programs should provide minimum resolution requirements if not text based scrolling
+is all it needs.
+
+Pop-ups with kernel panics or dialogs could cover any area.
+
+The shell scripting language will allow a few special case script-files called in an
+event like fashion. If .RUN is the default script exstension, AUTO.RUN would be used
+at boot. EXIT.RUN when exiting/rebooting, NOTFOUND.RUN to parse commands not understood
+and provide shortcuts for builtin commands. Cron like functionality for other
+scripts to be scheduled.
+
+GUI apps using build in functions for borders, pop-ups and such will scale perfectly
+from 80*25 textmode all the way to some VESA mode with polished graphics, like 1024*768.
\ No newline at end of file
;---------------------------------------------;
struc fat12
{
- .disk_number db 0 ; which VFS disk number
- .root_dir dw 0 ; position of rootdir
- .fat_1 dd 0 ; position of fat1
- .fat_2 dd 0 ; position of fat2
- .data_area dw 0 ; position of dataarea
- .disk_size dd 0 ; total storage size
- .free_space dd 0 ; free space available
- .boot bootsector
+ .disk_number db 0 ; which VFS disk number
+ .root_dir dw 0 ; position of rootdir
+ .fat_1 dd 0 ; position of fat1
+ .fat_2 dd 0 ; position of fat2
+ .data_area dw 0 ; position of dataarea
+ .disk_size dd 0 ; total storage size
+ .free_space dd 0 ; free space available
+ .boot: times sizeof.bootsector db 0 ; copy of FAT12 bootsector
.dir_entries:
- times 16 * sizeof.dir_entry db 0 ; 512b dir entry buffer
- .fat_buffer: times 512 db 0 ; 512b FAT cluster info buffer
+ times 16 * sizeof.dir_entry db 0 ; 512b dir entry buffer
+ .fat_buffer: times 512 db 0 ; 512b FAT cluster info buffer
+ .filehandles:
+ times 32 * sizeof.filehandle db 0 ; for now, max opened files is 32
}
virtual at 0 ; could use "at esi" instead
sizeof.lfn_entry = $-$$
end virtual
+ ;---------------------------------------------;
+ ; FAT12 file-handle structure ;
+ ;---------------------------------------------;
+ struc filehandle
+ {
+ .handles db 0 ; reference count or or zero for unused
+ .mode db 0 ; open mode. 0=read, 1=write, 2=r/w.
+ .lfn_entry dw 0 ; file LFN directory entry position
+ .direntry dw 0 ; file directory entry position
+ .cluster dw 0 ; file first cluster
+ .attribute db 0 ; file attributes
+ .filetime dw 0 ; last modified time
+ .filedate dw 0 ; last modified date
+ .filesize dd 0 ; filesize
+ .position dd 0 ; R/W position in file
+ .clusterpos dw 0 ; cluster number of last cluster read
+ }
+
+ virtual at 0
+ filehandle filehandle
+ sizeof.filehandle = $-$$
+ end virtual
+
;------------------------------------------;
; FAT cluster constants used ;
;------------------------------------------;
;drive dd 0
;mov edi, drive+fat12into.boot
+;--------------------------------------
+; possible interface to copy/follow,
+; add getFilename/path function?
+;--------------------------------------
+; INT 21,3C Create file using handle
+; INT 21,3D Open file using handle
+; INT 21,3E Close file using handle
+; INT 21,3F Read file or device using handle
+; INT 21,40 Write file or device using handle
+; INT 21,41 Delete file
+; INT 21,42 Move file pointer using handle
+; INT 21,43 Change file mode
+; INT 21,45 Duplicate file handle
+; INT 21,46 Force duplicate file handle
+; INT 21,56 Rename file
+; INT 21,57 Get/set file date and time using handle
+; INT 21,5A Create temporary file (3.x+)
+; INT 21,5B Create new file (3.x+)
+; INT 21,67 Set handle count (DOS 3.3+)
+
;--------------------------------------------------------------;
; init_fat12 - detect if drive fs is fat12 and init ;
;--------------------------------------------------------------;
;----------------------------------------------------------;
+ ; file handles need to be dword, where the high
+ ; word contains drive number, and the low word
+ ; is the drive/FS specific handle. limits FS to
+ ; a max of 65535 opened files. should be alright. ;)
+
+
;---------------------------------------------;
; VFS main structure ;
;---------------------------------------------;
times 255 * sizeof.VFS_storage db 0 ; storage driver structure
.filesystem:
times 255 * sizeof.VFS_filesystem db 0 ; filesystem driver structure
+ .mounted db 0 ; 1/0 switch if mounted
+ .current_path: times 255 db 0 ; drive opened path (increase max path size?)
}
virtual at 0 ; could use "at esi" instead