* mikeOS 16 bit and amd64 baremetal
[mascara-docs.git] / amd64 / bareMetalOS-0.5.2 / baremetal0.5.2 / os / syscalls / file.asm
blobd5d87debf4ee45764214a31fbf124bb92ddc14d7
1 ; =============================================================================
2 ; BareMetal -- a 64-bit OS written in Assembly for x86-64 systems
3 ; Copyright (C) 2008-2011 Return Infinity -- see LICENSE.TXT
5 ; File System Functions
6 ; =============================================================================
8 align 16
9 db 'DEBUG: FILESYS '
10 align 16
13 ; This source acts as an abstraction layer between the OS and an actual File
14 ; System driver. A check can go here to detect the actual FS used and call the
15 ; appropriate FS driver.
17 ; Example:
18 ; os_file_read:
19 ; cmp [os_FS], 1 ; FAT16
20 ; je os_fat16_file_read
21 ; cmp [os_FS], 2 ; FAT32
22 ; je os_fat32_file_read
23 ; etc...
26 ; -----------------------------------------------------------------------------
27 ; os_file_read -- Read a file from disk into memory
28 ; IN: RSI = Address of filename string
29 ; RDI = Memory location where file will be loaded to
30 ; OUT: Carry is set if the file was not found or an error occured
31 os_file_read:
32 jmp os_fat16_file_read
33 ; -----------------------------------------------------------------------------
36 ; -----------------------------------------------------------------------------
37 ; os_file_write -- Write a file from memory to disk
38 ; IN: RSI = Memory location of data to be written
39 ; RDI = Address of filename string
40 ; RCX = Number of bytes to write
41 ; OUT: Carry is set if an error occured
42 os_file_write:
43 jmp os_fat16_file_write
44 ; -----------------------------------------------------------------------------
47 ; -----------------------------------------------------------------------------
48 ; os_file_rename -- Rename a file on disk
49 ; IN: RSI = Memory location of file name to change
50 ; RDI = Memory location of new file name
51 ; OUT: Carry is set if the file was not found or an error occured
52 os_file_rename:
53 jmp $
54 ; -----------------------------------------------------------------------------
57 ; -----------------------------------------------------------------------------
58 ; os_file_delete -- Delete a file from disk
59 ; IN: RSI = Memory location of file name to delete
60 ; OUT: Carry is set if the file was not found or an error occured
61 os_file_delete:
62 jmp os_fat16_file_delete
63 ; -----------------------------------------------------------------------------
66 ; -----------------------------------------------------------------------------
67 ; os_file_get_list -- Generate a list of files on disk
68 ; IN: RDI = location to store list
69 ; OUT: RDI = pointer to end of list
70 os_file_get_list:
71 jmp os_fat16_get_file_list
72 ; -----------------------------------------------------------------------------
75 ; -----------------------------------------------------------------------------
76 ; os_file_size -- Return the size of a file on disk
77 ; IN: RSI = Address of filename string
78 ; OUT: RCX = Size in bytes
79 ; Carry is set if the file was not found or an error occured
80 os_file_get_size:
81 jmp os_fat16_get_file_size
82 ; -----------------------------------------------------------------------------
85 ; =============================================================================
86 ; EOF