Skip to content

Commit

Permalink
kernel: Add create VFS syscall
Browse files Browse the repository at this point in the history
  • Loading branch information
ry755 committed Mar 23, 2024
1 parent 6624b09 commit c0b2ae2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions fox32os.def
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ tell: jmp [0x00000D18]
read: jmp [0x00000D1C]
write: jmp [0x00000D20]
get_size: jmp [0x00000D24]
create: jmp [0x00000D28]

; widget jump table
draw_widgets_to_window: jmp [0x00000E10]
Expand Down
1 change: 1 addition & 0 deletions kernel/main.asm
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ jump_table:
data.32 read
data.32 write
data.32 get_size
data.32 create

; widget jump table
org.pad 0x00000610
Expand Down
14 changes: 14 additions & 0 deletions kernel/vfs/vfs.asm
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,20 @@ open_stream:
mov r0, 0
ret

; create a file on a RYFS-formatted disk
; inputs:
; r0: pointer to file name string (8.3 format, for example "testfile.txt" or "test.txt")
; r1: disk ID
; r2: file struct: pointer to a blank file struct
; r3: target file size
; outputs:
; r0: first file sector, or zero if file couldn't be created
create:
call convert_filename
cmp r0, 0
ifz ret
jmp ryfs_create

; seek specified file to the specified offset
; inputs:
; r0: byte offset
Expand Down

0 comments on commit c0b2ae2

Please sign in to comment.