⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fdos.a86

📁 一个dos操作系统DRDOS的源码
💻 A86
📖 第 1 页 / 共 2 页
字号:
	extrn	cur_dma_seg:word
	extrn	mult_sec:word
	extrn	rwmode:byte
	extrn	valid_flg:byte

NO_CRIT_ERRORS	equ	0100$0000b	; critical error shouldn't be generated
					; warning - must match PCMODE.EQU
	
	extrn	fdrwflg:byte
	extrn	chdblk:word
	extrn	dcnt:word
	extrn	dirp:word
	extrn	dirperclu:word
	extrn	finddfcb_mask:word
	extrn	hdsaddr:word
	extrn	intl_xlat:dword
	extrn 	lastcl:word
	extrn	logical_drv:byte
	extrn	pblock:dword
	extrn	physical_drv:byte
	extrn	req_hdr:byte
	

	extrn	yearsSince1980:word
	extrn	month:byte
	extrn	dayOfMonth:byte
	extrn	hour:byte
	extrn	minute:byte
	extrn	second:byte

orig_drive	dw	0
path_drive	dw	0


	Public	fdos_hds_blk, fdos_hds_root, fdos_hds_drv

fdos_hds	rw	0		; temporary HDS that we make up
fdos_hds_blk	dw	0
fdos_hds_root	dw	0
fdos_hds_drv	db	0

HDS_LEN		equ	offset $ - offset fdos_hds

saved_hds	rw	0		; saved HDS on F_DOS rename
saved_hds_blk	dw	0
saved_hds_root	dw	0
saved_hds_drv	db	0

saved_dcnt	dw	0		; saved DCNT on F_DOS rename

dta_ofl		db	0		; non-zero if read/write > DTA size

extflg		dw	0		; DOS FCB was extended FCB

blk		dw	0		; temp variable for cluster #

attributes	db	0		;fcb interface attributes hold byte

	public	info_fcb
info_fcb	rb	1+8+3		;local user FCB drive+name+ext

save_area	rb	32		;save area for dirbuf during rename and
					;info_fcb during create(mustbe_nolbl)
					;parental name during chdir

;	local variables for fdos operations

sp_save		dw	0

fdos_addr	dw	0		; address of F_DOS function

	Public	fdos_info, fdos_pb, fdos_ret
	
fdos_info	rw	3		; off, seg, size of parameter block
fdos_pb		rw	7		; copy of parameter block
fdos_ret	dw	0		; return value for function

if PASSWORD
; Password support uses the following data stuctures:
;
; The global_password field is set by an IOCTL call and remains constant.
;
; When a password is encountered during parsing a path the ASCII form is
; copied into the password_buffer. It is then encrypted and stored in the
; local_password field. If a password protected file is encountered then
; it's encrypted password is compared with both the global and local passwords.
;
; During a file/directory create the local_password field is examnined. If
; non-zero then this encrypted password is applied to the file, which is given
; full protection.
;
	Public	global_password
global_password	dw	0
local_password	dw	0
password_buffer	rb	8

endif

eject
BDOS_CODE	cseg


	extrn	pcmode_dseg:word	; Pointer to System Data Page

	extrn	get_ldt:near
	extrn	get_ldt_raw:near
	extrn	islocal:near		; redirector support
	extrn	redir_asciiz_offer:near
	extrn	redir_asciiz_dev_offer:near
	extrn	redir_asciiz_file_offer:near
	extrn	redir_drv_offer:near
	extrn	redir_dhndl_offer:near
	extrn	redir_move_offer:near
	extrn	redir_snext_offer:near

	extrn	alloc_cluster:NEAR
	extrn	allocdir:NEAR		; will extend subdirectory if full
	extrn	buffers_check:near
	extrn	discard_all:near
	extrn	close_dev:near		; close character device handle
	extrn	delfat:NEAR
	extrn	fdosrw:near		; read/write from/to disk file
	extrn	finddfcb:NEAR		; find next matching directory entry
	extrn	finddfcbf:NEAR		; find first matching directory entry
	extrn	first_dev:near		; find first matching character device
	extrn	fill_dirbuf:near
	extrn	flush_dirbuf:near
	extrn	flush_drive:near
	extrn	get_ddsc:near
	extrn	getdir:NEAR
	extrn	getnblk:NEAR
	extrn	hshdscrd:near		; discard hashing for drive AL

	extrn	mark_ldt_unsure:near
	extrn	redir_build_path:near	; build ASCII path

	extrn	open_dev:near		; open character device handle
	extrn	dup_dev:near		; call device driver on handle dup
	extrn	read_dev:near		; read from character device
	extrn	ReadTimeAndDate:near	; read date/time from CLOCK driver
	extrn	blockif:near
	extrn	ddioif:near
	extrn	select_logical_drv:near
	extrn	select_physical_drv:near
	extrn	setenddir:NEAR
	extrn	update_dat:NEAR		; flush dirty data buffers
	extrn	update_ddsc_free:NEAR	; count free blocks on drive
	extrn	update_dir:NEAR		; flush modified directory buffer
	extrn	update_fat:NEAR
	extrn	write_dev:near		; write to character device
	extrn	zeroblk:near		; fill cluster with 0's
	

eject
	public	bpb2ddsc		; build DDSC from a BPB
	Public	check_slash
	public	dbcs_lead
	public	discard_files		; discard open files (unconditional)
	public	fdos_ED_DRIVE		; Return ED_DRIVE error
	public	fdos_ED_FUNCTION	; Return ED_FUNCTION error
	public	find_dhndl
	public	find_xfn
	public	get_pb2_drive
	public	release_handle		; release file handle
	public	toupper			; upper case a character
	Public	unparse
	public	update_dir_fat		; flush DIR then FAT to disk

	public	fdos_getdpb	; 0-disk information
	public	fdos_mkdir	; 1-make directory
	public	fdos_rmdir	; 2-remove directory
	public	fdos_chdir	; 3-change directory
	public	fdos_creat	; 4-create file
	public	fdos_open	; 5-open file
	public	fdos_close	; 6-close file
	public	fdos_read	; 7-read from file
	public	fdos_write	; 8-write to file
	public	fdos_unlink	; 9-delete file
	public	fdos_lseek	; 10-set file pointer
	public	fdos_chmod	; 11-get/set file attributes
	public	fdos_curdir	; 12-get current directory
	public	fdos_first	; 13-find first matching file
	public	fdos_next	; 14-find next matching file
	public	fdos_move	; 15-rename file
	public	fdos_dattim	; 16-get/set file name
	public	fdos_flush	; 17-flush buffers
	public	fdos_mknew	; 18-make new file
	public	fdos_lock	; 19-lock/unlock block
	public	fdos_dup	; 20-duplicate handle
	public	fdos_fdup	; 21-force duplicate handle
	extrn	fdos_fcb:near	; 22-FCB emulation
	public	fdos_exec	; 23-create child PSP
	extrn	fdos_exit:near	; 24-FCB close for PSP
	public	fdos_ddio	; 25-direct disk access
	extrn	fdos_ioctl:near	; 26-IOCTL emulation
	public	fdos_commit	; 27-commit file
	public	fdos_expand	; 28-expand file name
	public	fdos_mkddsc	; 29-build DDSC from BPB
	public	fdos_select	; 30-select drive

if JOIN
	Public	check_join
	Public	mv_join_root
endif

eject

eject !	include	funcs.fdo
eject !	include	utils.fdo


	END

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -