Compare commits
3 Commits
1e181bc22c
...
trunk
| Author | SHA1 | Date | |
|---|---|---|---|
| 528e3d69fe | |||
| 9a6fea658d | |||
| 891bff9509 |
2
.github/workflows/daily.yaml
vendored
2
.github/workflows/daily.yaml
vendored
@@ -3,7 +3,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches: [ $default-branch ]
|
branches: [ $default-branch ]
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "0 7 * * *" # daily 07:00
|
- cron: "0 7 * * 1" # mondays at 07:00
|
||||||
workflow_dispatch: {}
|
workflow_dispatch: {}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|||||||
@@ -25,14 +25,9 @@ ALIGN 4, db 0x90
|
|||||||
InitFATDriver:
|
InitFATDriver:
|
||||||
__CDECL16_PROC_ENTRY
|
__CDECL16_PROC_ENTRY
|
||||||
.func:
|
.func:
|
||||||
mov ax, FAT32_State_t_size
|
|
||||||
push ax ; length of fat32_state structure
|
__CDECL16_CALL_ARGS fat32_state, 0x0000, FAT32_State_t_size
|
||||||
xor ax, ax
|
__CDECL16_CALL kmemset, 3
|
||||||
push ax ; init fat32_state with zero
|
|
||||||
mov ax, fat32_state
|
|
||||||
push ax ; address of structure
|
|
||||||
call kmemset
|
|
||||||
add sp, 0x6
|
|
||||||
|
|
||||||
.calc_active_part:
|
.calc_active_part:
|
||||||
mov ax, word [partition_offset]
|
mov ax, word [partition_offset]
|
||||||
@@ -111,13 +106,12 @@ SearchFATDIR:
|
|||||||
|
|
||||||
mov bx, fat32_state
|
mov bx, fat32_state
|
||||||
.load_first_dir:
|
.load_first_dir:
|
||||||
mov eax, dword [bx + FAT32_State_t.curr_dir_cluster_32]
|
|
||||||
push dword eax ; cluster
|
; uint8_t ReadFATCluster(uint16_t seg, uint16_t offset, uint32_t cluster)
|
||||||
mov ax, dir_buffer
|
push dword [bx + FAT32_State_t.curr_dir_cluster_32] ; cluster
|
||||||
push ax ; offset
|
push dir_buffer ; offset
|
||||||
xor ax, ax
|
push 0x0000 ; segment
|
||||||
push ax ; segment
|
call ReadFATCluster
|
||||||
call ReadFATCluster ; uint8_t ReadFATCluster(uint16_t seg, uint16_t offset, uint32_t cluster)
|
|
||||||
add sp, 0x8
|
add sp, 0x8
|
||||||
|
|
||||||
mov si, dir_buffer
|
mov si, dir_buffer
|
||||||
@@ -127,9 +121,9 @@ SearchFATDIR:
|
|||||||
; if eax >= 0x0FFFFFF8 then there are no more clusters (end of chain)
|
; if eax >= 0x0FFFFFF8 then there are no more clusters (end of chain)
|
||||||
; if eax == 0x0FFFFFF7 then this is a cluster that is marked as bad
|
; if eax == 0x0FFFFFF7 then this is a cluster that is marked as bad
|
||||||
|
|
||||||
mov eax, dword [bx + FAT32_State_t.curr_dir_cluster_32]
|
; uint32_t NextCluster(uint32_t active_cluster);
|
||||||
push dword eax
|
push dword [bx + FAT32_State_t.curr_dir_cluster_32]
|
||||||
call NextCluster ; uint32_t NextCluster(uint32_t active_cluster);
|
call NextCluster
|
||||||
add sp, 0x4
|
add sp, 0x4
|
||||||
|
|
||||||
cmp eax, 0x0fff_fff7
|
cmp eax, 0x0fff_fff7
|
||||||
@@ -139,16 +133,14 @@ SearchFATDIR:
|
|||||||
|
|
||||||
.load_next_dir_next_OK:
|
.load_next_dir_next_OK:
|
||||||
; load 512 bytes of directory entries from data sector
|
; load 512 bytes of directory entries from data sector
|
||||||
mov eax, [bx + FAT32_State_t.curr_dir_cluster_32]
|
|
||||||
push dword eax ; cluster
|
|
||||||
|
|
||||||
mov ax, dir_buffer
|
; uint8_t ReadFATCluster(uint16_t seg, uint16_t offset, uint32_t cluster)
|
||||||
push ax ; offset
|
push dword [bx + FAT32_State_t.curr_dir_cluster_32] ; cluster
|
||||||
|
push dir_buffer ; offset
|
||||||
xor ax, ax
|
push 0x0000 ; segment
|
||||||
push ax ; segment
|
call ReadFATCluster
|
||||||
call ReadFATCluster ; uint8_t ReadFATCluster(uint16_t seg, uint16_t offset, uint32_t cluster)
|
|
||||||
add sp, 0x8
|
add sp, 0x8
|
||||||
|
|
||||||
.empty_dir_entry:
|
.empty_dir_entry:
|
||||||
; check for 0x0 in first byte, if true then there are no more files
|
; check for 0x0 in first byte, if true then there are no more files
|
||||||
; if true we did not find the file, we should error here
|
; if true we did not find the file, we should error here
|
||||||
@@ -219,16 +211,10 @@ NextCluster:
|
|||||||
__CDECL16_CALL_ARGS NextFATCluster_info
|
__CDECL16_CALL_ARGS NextFATCluster_info
|
||||||
__CDECL16_CALL PrintString, 1
|
__CDECL16_CALL PrintString, 1
|
||||||
|
|
||||||
mov ax, FAT32_NextClusterData_t_size
|
__CDECL16_CALL_ARGS fat32_nc_data, 0x0000, FAT32_NextClusterData_t_size
|
||||||
push ax ; length
|
__CDECL16_CALL kmemset, 3
|
||||||
xor ax, ax
|
|
||||||
push ax ; init with zero
|
|
||||||
mov ax, fat32_nc_data
|
|
||||||
push ax ; address of structure
|
|
||||||
call kmemset
|
|
||||||
add sp, 0x6
|
|
||||||
|
|
||||||
mov edx, dword [bp + 4]
|
mov edx, dword [bp + 4] ; active_cluster
|
||||||
mov si, fat32_nc_data ; instead of push/pop and moving the data back
|
mov si, fat32_nc_data ; instead of push/pop and moving the data back
|
||||||
mov di, fat32_bpb ; load si & di then use xchg
|
mov di, fat32_bpb ; load si & di then use xchg
|
||||||
mov bx, fat32_state
|
mov bx, fat32_state
|
||||||
@@ -279,6 +265,7 @@ NextCluster:
|
|||||||
mov ebx, dword [si + FAT32_NextClusterData_t.entry_offset]
|
mov ebx, dword [si + FAT32_NextClusterData_t.entry_offset]
|
||||||
mov si, fat_buffer
|
mov si, fat_buffer
|
||||||
mov eax, dword [bx+si+0]
|
mov eax, dword [bx+si+0]
|
||||||
|
; BUG: ???
|
||||||
.endp:
|
.endp:
|
||||||
__CDECL16_PROC_EXIT
|
__CDECL16_PROC_EXIT
|
||||||
ret
|
ret
|
||||||
|
|||||||
@@ -124,8 +124,11 @@ if [[ "$OSTYPE" == "linux-gnu"* ]]; then
|
|||||||
echo "[2/7] Write DOS partition table (single FAT32 LBA @ 2048)"
|
echo "[2/7] Write DOS partition table (single FAT32 LBA @ 2048)"
|
||||||
"$SF" --no-reread "$disk_img" < /tmp/pt.sfdisk
|
"$SF" --no-reread "$disk_img" < /tmp/pt.sfdisk
|
||||||
|
|
||||||
echo "[3/7] Make FAT32 filesystem in partition image"
|
# BUG: the default disk img is 256MiB which mkfs.fat wants to create
|
||||||
"$MKFS" -v -F32 -s 1 -n 'STEVIAFS' "$part_img"
|
# a FAT16 FS by default. it needs to be at least 2GiB to to 'lock out'
|
||||||
|
# FAT16 as an option. Force FAT32 here, might(?) break some things.
|
||||||
|
echo "[3/7] Make FAT filesystem in partition image"
|
||||||
|
"$MKFS" -F32 -v -n 'STEVIAFS' "$part_img"
|
||||||
|
|
||||||
echo "[4/7] Patch VBR inside partition image (preserve BPB)"
|
echo "[4/7] Patch VBR inside partition image (preserve BPB)"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user