mirror of
https://github.com/fosslinux/live-bootstrap.git
synced 2026-03-04 10:25:25 +01:00
Use alias to build Fiwix and make checksums work.
This commit is contained in:
parent
3c817913c7
commit
c19ca08f15
3 changed files with 307 additions and 292 deletions
|
|
@ -48,6 +48,7 @@
|
|||
# handle_syscall_execve
|
||||
# handle_syscall_chdir
|
||||
# handle_syscall_exit
|
||||
# handle_syscall_waitpid
|
||||
# handle_syscall_lseek
|
||||
# handle_syscall_access
|
||||
# handle_syscall_mkdir
|
||||
|
|
@ -479,7 +480,7 @@ BD 00 00 00 08 # mov ebp, 0x08000000
|
|||
89 EC # mov esp, ebp
|
||||
|
||||
9A 7C 7D 00 00 08 00 # call setup_interrupt_handlers
|
||||
EA 93 88 00 00 08 00 # jmp internalshell
|
||||
EA A1 88 00 00 08 00 # jmp internalshell
|
||||
|
||||
|
||||
#----------------------------------------
|
||||
|
|
@ -1110,7 +1111,7 @@ A1 8C 7F 00 00 # mov eax, [next_filenum]
|
|||
89 C7 # mov edi, eax
|
||||
C1 E7 0A # shl edi, 0x0a
|
||||
81 C7 00 00 20 00 # add edi, 0x0200000
|
||||
9A B8 85 00 00 08 00 # call strcmp
|
||||
9A C6 85 00 00 08 00 # call strcmp
|
||||
74 08 # je find_file_finish
|
||||
48 # dec eax
|
||||
EB E4 # jmp checkfile
|
||||
|
|
@ -1738,7 +1739,7 @@ CB # ret ; go back to parent
|
|||
8B 35 1A 83 00 00 # mov esi, [&next_process_num]
|
||||
4E # dec esi = current process
|
||||
C1 E6 0C # shl esi, 0x0C
|
||||
81 C6 04 02 02 00 # add esi, 0x0020018 ; pchild_code = &pproc_descriptor[current_process_num].child_exit_code
|
||||
81 C6 18 00 02 00 # add esi, 0x00020018 ; pchild_code = &pproc_descriptor[current_process_num].child_exit_code
|
||||
8B 06 # mov eax, [esi] ; get exit code
|
||||
C1 E0 08 # shl eax, 0x08 ;
|
||||
89 01 # mov [ecx], eax ; waitval = ret << 8
|
||||
|
|
@ -1847,12 +1848,21 @@ CB # ret
|
|||
C1 E6 0C # shl esi, 0x0C
|
||||
81 C6 00 01 02 00 # add esi, 0x0020100 ; pproc_descriptor = &pproc_descriptor[current_process_num].current_dir
|
||||
|
||||
# Handle root differently because we don't strip trailing slash
|
||||
66 83 3E 2F # cmp word [esi], $002f ; is cwd == "/" ?
|
||||
75 04 # jne copy_cwd
|
||||
66 A5 # movsw ; copy "/" to buffer
|
||||
EB 0A # jmp cleanup
|
||||
|
||||
# copy_cwd
|
||||
AC # lodsb
|
||||
AA # stosb
|
||||
3C 00 # cmp al, 0
|
||||
75 FA # jne copy_cwd
|
||||
83 EF 02 # sub edi, 2 ; strip trailing slash
|
||||
AA # stosb
|
||||
|
||||
# cleanup
|
||||
89 D8 # mov eax, ebx
|
||||
5F # pop edi
|
||||
5E # pop esi
|
||||
|
|
@ -1860,7 +1870,7 @@ CB # ret
|
|||
|
||||
|
||||
#------------------------------------------------------------
|
||||
#[85B8]
|
||||
#[85C6]
|
||||
#:strcmp
|
||||
# inputs:
|
||||
# esi: string1
|
||||
|
|
@ -1894,19 +1904,19 @@ CB # ret
|
|||
|
||||
|
||||
#------
|
||||
#[85D3]
|
||||
#[85E1]
|
||||
#:io_char
|
||||
00
|
||||
00 # free
|
||||
|
||||
#----------------------------------------
|
||||
#[85D5]
|
||||
#[85E3]
|
||||
#:read
|
||||
53 # push ebx
|
||||
51 # push ecx
|
||||
52 # push edx
|
||||
B8 03 00 00 00 # mov eax, 3 ; syscall=read
|
||||
B9 D3 85 00 00 # mov ecx, &io_char
|
||||
B9 E1 85 00 00 # mov ecx, &io_char
|
||||
BA 01 00 00 00 # mov edx, 1
|
||||
|
||||
CD 80 # int 80 syscall
|
||||
|
|
@ -1915,7 +1925,7 @@ CD 80 # int 80 syscall
|
|||
74 07 # je read_finish
|
||||
|
||||
B4 01 # mov ah, 1
|
||||
A0 D3 85 00 00 # mov al, &io_char
|
||||
A0 E1 85 00 00 # mov al, &io_char
|
||||
|
||||
#:read_finish
|
||||
5A # pop edx
|
||||
|
|
@ -1925,16 +1935,16 @@ CB # ret
|
|||
|
||||
|
||||
#----------------------------------------
|
||||
#[85F8]
|
||||
#[8606]
|
||||
#:write
|
||||
50 # push eax
|
||||
53 # push ebx
|
||||
51 # push ecx
|
||||
52 # push edx
|
||||
|
||||
A2 D3 85 00 00 # mov &io_char, al
|
||||
A2 E1 85 00 00 # mov &io_char, al
|
||||
B8 04 00 00 00 # mov eax, 4 ; syscall=write
|
||||
B9 D3 85 00 00 # mov ecx, &io_char
|
||||
B9 E1 85 00 00 # mov ecx, &io_char
|
||||
BA 01 00 00 00 # mov edx, 1 1 byte characters
|
||||
CD 80 # int 80 syscall
|
||||
|
||||
|
|
@ -1946,7 +1956,7 @@ CB # ret
|
|||
|
||||
|
||||
#------
|
||||
#[8617]
|
||||
#[8625]
|
||||
#:string_src
|
||||
#s r c \0
|
||||
73 72 63 00
|
||||
|
|
@ -1960,7 +1970,7 @@ CB # ret
|
|||
# Read a newline.
|
||||
# Then, read N bytes from stdin and write to the new file.
|
||||
#----------------------------------------
|
||||
#[861B]
|
||||
#[8629]
|
||||
#:src
|
||||
50 # push eax
|
||||
53 # push ebx
|
||||
|
|
@ -1969,16 +1979,16 @@ CB # ret
|
|||
56 # push esi
|
||||
57 # push edi
|
||||
|
||||
BE 17 86 00 00 # mov esi, string_src
|
||||
BE 25 86 00 00 # mov esi, string_src
|
||||
9A 8F 7E 00 00 08 00 # call console_puts
|
||||
|
||||
9A D5 85 00 00 08 00 # call read 'r'
|
||||
9A D5 85 00 00 08 00 # call read 'c'
|
||||
9A D5 85 00 00 08 00 # call read ' '
|
||||
9A E3 85 00 00 08 00 # call read 'r'
|
||||
9A E3 85 00 00 08 00 # call read 'c'
|
||||
9A E3 85 00 00 08 00 # call read ' '
|
||||
|
||||
31 C9 # xor ecx, ecx ; line count=0
|
||||
#parse_line_count_loop:
|
||||
9A D5 85 00 00 08 00 # call read
|
||||
9A E3 85 00 00 08 00 # call read
|
||||
3C 20 # cmp al, ' '
|
||||
74 0C # je got_count
|
||||
|
||||
|
|
@ -2006,7 +2016,7 @@ B9 00 08 00 00 # mov ecx, 0x00000800
|
|||
51 # push ecx
|
||||
B9 00 00 D0 04 # mov ecx, 0x04D00000
|
||||
#:get_filename_loop
|
||||
9A D5 85 00 00 08 00 # call read
|
||||
9A E3 85 00 00 08 00 # call read
|
||||
|
||||
3C 0A # cmp al, '\n'
|
||||
74 05 # je got_filename
|
||||
|
|
@ -2037,10 +2047,10 @@ CD 80 # int 80
|
|||
BF 00 02 04 00 # mov edi, 0x00040200 ; scratch buffer
|
||||
57 # push edi ; save buffer address
|
||||
31 DB # xor ebx, ebx ; ebx=0=stdin
|
||||
9A D5 85 00 00 08 00 # call read
|
||||
9A E3 85 00 00 08 00 # call read
|
||||
89 D3 # mov ebx, edx ; prepare to write
|
||||
5E # pop esi ; restore buffer address to esi
|
||||
9A F8 85 00 00 08 00 # call write
|
||||
9A 06 86 00 00 08 00 # call write
|
||||
49 # dec ecx ; count--
|
||||
EB E0 # jmp read_write_loop
|
||||
|
||||
|
|
@ -2056,25 +2066,25 @@ CB # ret
|
|||
|
||||
|
||||
#------
|
||||
#[86D3]
|
||||
#[86E1]
|
||||
#:hex0_str
|
||||
#h e x 0 \0
|
||||
68 65 78 30 00
|
||||
|
||||
#------------------------------------------------------------
|
||||
#[86D8]
|
||||
#[86E6]
|
||||
#:hex0
|
||||
53 # push ebx
|
||||
56 # push esi
|
||||
57 # push edi
|
||||
|
||||
BE D3 86 00 00 # mov esi, hex0_str
|
||||
BE E1 86 00 00 # mov esi, hex0_str
|
||||
9A 8F 7E 00 00 08 00 # call console_puts
|
||||
|
||||
# read "ex0 '
|
||||
B1 04 # mov cl, 4
|
||||
#:ex0_loop
|
||||
9A D5 85 00 00 08 00 # call read
|
||||
9A E3 85 00 00 08 00 # call read
|
||||
FE C9 # dec cl
|
||||
75 F5 # jnz ex0_loop
|
||||
|
||||
|
|
@ -2090,7 +2100,7 @@ B9 00 08 00 00 # mov ecx, 0x00000800
|
|||
|
||||
BA 00 00 D0 04 # mov edx, 0x04D00000
|
||||
#:get_file_name1_loop
|
||||
9A D5 85 00 00 08 00 # call read
|
||||
9A E3 85 00 00 08 00 # call read
|
||||
9A 6F 7E 00 00 08 00 # call console_putc
|
||||
3C 20 # cmp al, ' '
|
||||
74 05 # je got_filename1
|
||||
|
|
@ -2101,7 +2111,7 @@ EB E9 # jmp get_file_name1_loop
|
|||
#:got_filename1
|
||||
BA 00 04 D0 04 # mov edx, 0x04D00400
|
||||
#:get_file_name2_loop
|
||||
9A D5 85 00 00 08 00 # call read
|
||||
9A E3 85 00 00 08 00 # call read
|
||||
9A 6F 7E 00 00 08 00 # call console_putc
|
||||
3C 0A # cmp al, '\n'
|
||||
74 05 # je got_filename2
|
||||
|
|
@ -2132,11 +2142,11 @@ CD 80 # int 80
|
|||
|
||||
|
||||
#------
|
||||
#[876B]
|
||||
#[8779]
|
||||
#:hex0_read_loop
|
||||
53 # push ebx
|
||||
89 CB # mov ebx, ecx
|
||||
9A D5 85 00 00 08 00 # call read
|
||||
9A E3 85 00 00 08 00 # call read
|
||||
5B # pop ebx
|
||||
|
||||
84 e4 # test ah, ah
|
||||
|
|
@ -2189,7 +2199,7 @@ EB 11 # jmp maybe_store
|
|||
#:skip_comment
|
||||
53 # push ebx
|
||||
89 CB # mov ebx, ecx
|
||||
9A D5 85 00 00 08 00 # call read
|
||||
9A E3 85 00 00 08 00 # call read
|
||||
5B # pop ebx
|
||||
3C 0A # cmp al, '\n'
|
||||
75 F1 # jnz skip_comment
|
||||
|
|
@ -2214,26 +2224,26 @@ EB A3 # jmp hex0_read_loop
|
|||
|
||||
53 # push ebx
|
||||
89 D3 # mov ebx, edx
|
||||
9A F8 85 00 00 08 00 # call write
|
||||
9A 06 86 00 00 08 00 # call write
|
||||
5B # pop ebx
|
||||
|
||||
31 DB # xor bx, bx
|
||||
EA 6B 87 00 00 08 00 # jmp hex0_read_loop
|
||||
EA 79 87 00 00 08 00 # jmp hex0_read_loop
|
||||
|
||||
|
||||
#------
|
||||
#[87E0]
|
||||
#[87EE]
|
||||
#:cmd_args
|
||||
00 00 D0 04
|
||||
00 04 D0 04
|
||||
|
||||
#------
|
||||
#[87E8]
|
||||
#[87F6]
|
||||
#:cmd_env
|
||||
00 00 00 00
|
||||
|
||||
#------------------------------------------------------------
|
||||
#[87EC]
|
||||
#[87FA]
|
||||
#:handle_other_command
|
||||
50 # push eax
|
||||
53 # push ebx
|
||||
|
|
@ -2255,7 +2265,7 @@ B9 FF 07 00 00 # mov ecx, 0x000007FF
|
|||
|
||||
BA 01 00 D0 04 # mov edx, 0x04D00001
|
||||
#:get_program_name
|
||||
9A D5 85 00 00 08 00 # call read
|
||||
9A E3 85 00 00 08 00 # call read
|
||||
3C 20 # cmp al, ' '
|
||||
74 05 # je got_program_name
|
||||
88 02 # mov [edx], al
|
||||
|
|
@ -2265,7 +2275,7 @@ EB F0 # jmp get_program_name
|
|||
#got_program_name
|
||||
BA 00 04 D0 04 # mov edx, 0x04D00400
|
||||
#get_argument1_loop
|
||||
9A D5 85 00 00 08 00 # call read
|
||||
9A E3 85 00 00 08 00 # call read
|
||||
3C 0A # cmp al, '\n'
|
||||
74 05 # je got_argument1
|
||||
88 02 # mov [edx], al
|
||||
|
|
@ -2280,8 +2290,8 @@ BE 00 04 D0 04 # mov esi, arg1
|
|||
9A 8F 7E 00 00 08 00 # call console_puts
|
||||
|
||||
BB 00 00 D0 04 # mov ebx, program_name
|
||||
B9 E0 87 00 00 # mov ecx, cmd_args
|
||||
BA E8 87 00 00 # mov edx, cmd_env
|
||||
B9 EE 87 00 00 # mov ecx, cmd_args
|
||||
BA F6 87 00 00 # mov edx, cmd_env
|
||||
9A 1E 83 00 00 08 00 # call handle_syscall_execve
|
||||
|
||||
5E # pop esi
|
||||
|
|
@ -2293,26 +2303,26 @@ CB
|
|||
|
||||
|
||||
#------
|
||||
#[8864]
|
||||
#[8872]
|
||||
#:str_build_finished
|
||||
#B u i l d f i n i s h e d . \0
|
||||
42 75 69 6C 64 20 66 69 6E 69 73 68 65 64 2E 00
|
||||
|
||||
#------
|
||||
#[8874]
|
||||
#[8882]
|
||||
#:str_error_no_writes
|
||||
#E R R O R : n o h d a w r i t e s ! \0
|
||||
45 52 52 4F 52 3A 20 6E 6F 20 68 64 61 20 77 72 69 74 65 73 21 00
|
||||
|
||||
#------
|
||||
#[888A]
|
||||
#[8898]
|
||||
#:str_dev_hda
|
||||
#/ d e v / h d a \0
|
||||
2F 64 65 76 2F 68 64 61 00
|
||||
|
||||
|
||||
#------------------------------------------------------------
|
||||
#[8893]
|
||||
#[88A1]
|
||||
#:internalshell
|
||||
# Start reading stdin from sector 8, cyl 0, head 0
|
||||
C7 05 00 00 00 01 08 00 00 00 # mov word [0x01000000], 0x00000008
|
||||
|
|
@ -2331,7 +2341,7 @@ F3 AA # rep stosb
|
|||
31 DB # xor ebx, ebx
|
||||
|
||||
#:process_command
|
||||
9A D5 85 00 00 08 00 # call read
|
||||
9A E3 85 00 00 08 00 # call read
|
||||
3C 00 # cmp al, 0
|
||||
74 23 # je build_finished
|
||||
|
||||
|
|
@ -2340,7 +2350,7 @@ F3 AA # rep stosb
|
|||
75 09 # jne check_hex0_command
|
||||
|
||||
#:handle_src_command
|
||||
9A 1B 86 00 00 08 00 # call src
|
||||
9A 29 86 00 00 08 00 # call src
|
||||
EB E8 # jmp process_command
|
||||
|
||||
#:check_hex0_command
|
||||
|
|
@ -2348,25 +2358,25 @@ EB E8 # jmp process_command
|
|||
75 09 # jne call_handle_other_command
|
||||
|
||||
#:handle_hex0_command
|
||||
9A D8 86 00 00 08 00 # call hex0
|
||||
9A E6 86 00 00 08 00 # call hex0
|
||||
EB DB # jmp process_command
|
||||
|
||||
#:call_handle_other_command
|
||||
9A EC 87 00 00 08 00 # call handle_other_command
|
||||
9A FA 87 00 00 08 00 # call handle_other_command
|
||||
EB D2 # jmp process_command
|
||||
|
||||
#:build_finished
|
||||
BE 64 88 00 00 # mov esi, str_build_finished
|
||||
BE 72 88 00 00 # mov esi, str_build_finished
|
||||
9A 8F 7E 00 00 08 00 # call console_puts
|
||||
|
||||
# copy memory file /dev/hda to the boot disk
|
||||
BB 8A 88 00 00 # mov ebx, str_dev_hda
|
||||
BB 98 88 00 00 # mov ebx, str_dev_hda
|
||||
9A 13 81 00 00 08 00 # call find_file
|
||||
83 f8 ff # cmp eax, -1
|
||||
75 17 # jne ok_exit
|
||||
|
||||
#:error_exit
|
||||
BE 74 88 00 00 # mov esi, str_error_no_write
|
||||
BE 82 88 00 00 # mov esi, str_error_no_write
|
||||
9A 8F 7E 00 00 08 00 # call console_puts
|
||||
|
||||
# one space to flush last line
|
||||
|
|
@ -2421,8 +2431,7 @@ B0 20 # mov al, 20
|
|||
EA CD 7E 00 00 08 00 # jmp reboot
|
||||
|
||||
# sector padding
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue