ran sh command

This commit is contained in:
os 2023-11-29 14:19:51 -05:00
parent f9879ab449
commit f04d52c2c2
13 changed files with 8214 additions and 0 deletions

0
Part4/10_scheduler/e_compile.sh Normal file → Executable file
View File

View File

@ -0,0 +1,182 @@
.file "globals.c"
.text
.Ltext0:
.comm free_mem_addr,4,4
.comm global_id,4,4
.comm memory_limit,4,4
.Letext0:
.file 1 "./libc/globals.c"
.file 2 "./libc/../cpu/types.h"
.section .debug_info,"",@progbits
.Ldebug_info0:
.long 0x82
.value 0x4
.long .Ldebug_abbrev0
.byte 0x4
.uleb128 0x1
.long .LASF8
.byte 0xc
.long .LASF9
.long .LASF10
.long .Ldebug_line0
.uleb128 0x2
.string "u32"
.byte 0x2
.byte 0x6
.long 0x28
.uleb128 0x3
.byte 0x4
.byte 0x7
.long .LASF0
.uleb128 0x4
.byte 0x4
.byte 0x5
.string "int"
.uleb128 0x3
.byte 0x2
.byte 0x7
.long .LASF1
.uleb128 0x3
.byte 0x2
.byte 0x5
.long .LASF2
.uleb128 0x3
.byte 0x1
.byte 0x8
.long .LASF3
.uleb128 0x3
.byte 0x1
.byte 0x6
.long .LASF4
.uleb128 0x5
.long .LASF5
.byte 0x1
.byte 0x3
.long 0x1d
.uleb128 0x5
.byte 0x3
.long free_mem_addr
.uleb128 0x5
.long .LASF6
.byte 0x1
.byte 0x4
.long 0x1d
.uleb128 0x5
.byte 0x3
.long global_id
.uleb128 0x5
.long .LASF7
.byte 0x1
.byte 0x5
.long 0x1d
.uleb128 0x5
.byte 0x3
.long memory_limit
.byte 0
.section .debug_abbrev,"",@progbits
.Ldebug_abbrev0:
.uleb128 0x1
.uleb128 0x11
.byte 0x1
.uleb128 0x25
.uleb128 0xe
.uleb128 0x13
.uleb128 0xb
.uleb128 0x3
.uleb128 0xe
.uleb128 0x1b
.uleb128 0xe
.uleb128 0x10
.uleb128 0x17
.byte 0
.byte 0
.uleb128 0x2
.uleb128 0x16
.byte 0
.uleb128 0x3
.uleb128 0x8
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.byte 0
.byte 0
.uleb128 0x3
.uleb128 0x24
.byte 0
.uleb128 0xb
.uleb128 0xb
.uleb128 0x3e
.uleb128 0xb
.uleb128 0x3
.uleb128 0xe
.byte 0
.byte 0
.uleb128 0x4
.uleb128 0x24
.byte 0
.uleb128 0xb
.uleb128 0xb
.uleb128 0x3e
.uleb128 0xb
.uleb128 0x3
.uleb128 0x8
.byte 0
.byte 0
.uleb128 0x5
.uleb128 0x34
.byte 0
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.uleb128 0x3f
.uleb128 0x19
.uleb128 0x2
.uleb128 0x18
.byte 0
.byte 0
.byte 0
.section .debug_aranges,"",@progbits
.long 0x14
.value 0x2
.long .Ldebug_info0
.byte 0x4
.byte 0
.value 0
.value 0
.long 0
.long 0
.section .debug_line,"",@progbits
.Ldebug_line0:
.section .debug_str,"MS",@progbits,1
.LASF0:
.string "unsigned int"
.LASF6:
.string "global_id"
.LASF10:
.string "/home/os/OS_Project/Part4/10_scheduler"
.LASF3:
.string "unsigned char"
.LASF8:
.string "GNU C11 5.4.0 20160609 -m32 -mtune=generic -march=i686 -g -fno-pie -ffreestanding -fno-builtin -fno-stack-protector"
.LASF2:
.string "short int"
.LASF5:
.string "free_mem_addr"
.LASF7:
.string "memory_limit"
.LASF1:
.string "short unsigned int"
.LASF4:
.string "char"
.LASF9:
.string "./libc/globals.c"
.ident "GCC: (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609"
.section .note.GNU-stack,"",@progbits

871
Part4/10_scheduler/hello.s Normal file
View File

@ -0,0 +1,871 @@
.file "hello.c"
.text
.Ltext0:
.comm idt,2048,32
.comm idt_reg,6,4
.section .rodata
.LC0:
.string "Process "
.align 4
.LC1:
.string "has been entered. Hey there.\n"
.text
.globl start_
.type start_, @function
start_:
.LFB0:
.file 1 "hello.c"
.loc 1 18 0
.cfi_startproc
pushl %ebp
.cfi_def_cfa_offset 8
.cfi_offset 5, -8
movl %esp, %ebp
.cfi_def_cfa_register 5
subl $40, %esp
.loc 1 19 0
movl $0, -12(%ebp)
.loc 1 21 0
subl $12, %esp
pushl $.LC0
call kprint
addl $16, %esp
.loc 1 22 0
subl $8, %esp
leal -28(%ebp), %eax
pushl %eax
pushl -12(%ebp)
call hex_to_ascii
addl $16, %esp
.loc 1 23 0
subl $12, %esp
leal -28(%ebp), %eax
pushl %eax
call kprint
addl $16, %esp
.loc 1 24 0
subl $12, %esp
pushl $.LC1
call kprint
addl $16, %esp
.loc 1 25 0
nop
.loc 1 26 0
leave
.cfi_restore 5
.cfi_def_cfa 4, 4
ret
.cfi_endproc
.LFE0:
.size start_, .-start_
.section .rodata
.LC2:
.string "END"
.LC3:
.string "Stopping the CPU. Bye!\n"
.LC4:
.string "ADD"
.LC5:
.string "ADDED: "
.LC6:
.string " id: "
.LC7:
.string "ZOO"
.LC8:
.string "ZOO.\n"
.LC9:
.string "You said: "
.LC10:
.string "\n> "
.text
.globl user_input
.type user_input, @function
user_input:
.LFB1:
.loc 1 28 0
.cfi_startproc
pushl %ebp
.cfi_def_cfa_offset 8
.cfi_offset 5, -8
movl %esp, %ebp
.cfi_def_cfa_register 5
subl $40, %esp
.loc 1 29 0
subl $8, %esp
pushl $.LC2
pushl 8(%ebp)
call strcmp
addl $16, %esp
testl %eax, %eax
jne .L4
.loc 1 30 0
subl $12, %esp
pushl $.LC3
call kprint
addl $16, %esp
.loc 1 31 0
#APP
# 31 "hello.c" 1
hlt
# 0 "" 2
#NO_APP
jmp .L5
.L4:
.loc 1 32 0
subl $8, %esp
pushl $.LC4
pushl 8(%ebp)
call strcmp
addl $16, %esp
testl %eax, %eax
jne .L6
.LBB2:
.loc 1 33 0
movl $16, -12(%ebp)
addl $4, -12(%ebp)
.loc 1 34 0
movl $0, -16(%ebp)
.loc 1 35 0
subl $4, %esp
leal -16(%ebp), %eax
pushl %eax
pushl $0
pushl $20
call kmalloc
addl $16, %esp
.loc 1 36 0
movl -16(%ebp), %edx
movl global_id, %eax
leal 1(%eax), %ecx
movl %ecx, global_id
movl %eax, (%edx)
.loc 1 37 0
movl -16(%ebp), %eax
movl global_id, %edx
imull $100, %edx, %edx
movl %edx, 4(%eax)
.loc 1 38 0
movl -16(%ebp), %ecx
movl global_id, %edx
movl %edx, %eax
sall $2, %eax
addl %edx, %eax
addl %eax, %eax
movl %eax, 8(%ecx)
.loc 1 39 0
movl -16(%ebp), %eax
movl $0, 12(%eax)
.loc 1 40 0
movl -16(%ebp), %eax
movl $0, 16(%eax)
.loc 1 41 0
subl $12, %esp
pushl $.LC5
call kprint
addl $16, %esp
.loc 1 43 0
movl -16(%ebp), %eax
movl %eax, %edx
subl $8, %esp
leal -32(%ebp), %eax
pushl %eax
pushl %edx
call hex_to_ascii
addl $16, %esp
.loc 1 44 0
subl $12, %esp
leal -32(%ebp), %eax
pushl %eax
call kprint
addl $16, %esp
.loc 1 45 0
subl $12, %esp
pushl $.LC6
call kprint
addl $16, %esp
.loc 1 46 0
movl -16(%ebp), %eax
movl (%eax), %eax
movl %eax, %edx
subl $8, %esp
leal -32(%ebp), %eax
pushl %eax
pushl %edx
call hex_to_ascii
addl $16, %esp
.loc 1 47 0
subl $12, %esp
leal -32(%ebp), %eax
pushl %eax
call kprint
addl $16, %esp
.LBE2:
jmp .L5
.L6:
.loc 1 48 0
subl $8, %esp
pushl $.LC7
pushl 8(%ebp)
call strcmp
addl $16, %esp
testl %eax, %eax
jne .L5
.loc 1 49 0
subl $12, %esp
pushl $.LC8
call kprint
addl $16, %esp
.L5:
.loc 1 52 0
subl $12, %esp
pushl $.LC9
call kprint
addl $16, %esp
.loc 1 53 0
subl $12, %esp
pushl 8(%ebp)
call kprint
addl $16, %esp
.loc 1 54 0
subl $12, %esp
pushl $.LC10
call kprint
addl $16, %esp
.loc 1 55 0
nop
leave
.cfi_restore 5
.cfi_def_cfa 4, 4
ret
.cfi_endproc
.LFE1:
.size user_input, .-user_input
.Letext0:
.file 2 "./cpu/types.h"
.file 3 "./cpu/idt.h"
.file 4 "./libc/mem.h"
.file 5 "./libc/globals.h"
.section .debug_info,"",@progbits
.Ldebug_info0:
.long 0x22b
.value 0x4
.long .Ldebug_abbrev0
.byte 0x4
.uleb128 0x1
.long .LASF22
.byte 0xc
.long .LASF23
.long .LASF24
.long .Ltext0
.long .Letext0-.Ltext0
.long .Ldebug_line0
.uleb128 0x2
.string "u32"
.byte 0x2
.byte 0x6
.long 0x30
.uleb128 0x3
.byte 0x4
.byte 0x7
.long .LASF0
.uleb128 0x4
.byte 0x4
.byte 0x5
.string "int"
.uleb128 0x2
.string "u16"
.byte 0x2
.byte 0x8
.long 0x49
.uleb128 0x3
.byte 0x2
.byte 0x7
.long .LASF1
.uleb128 0x3
.byte 0x2
.byte 0x5
.long .LASF2
.uleb128 0x2
.string "u8"
.byte 0x2
.byte 0xa
.long 0x61
.uleb128 0x3
.byte 0x1
.byte 0x8
.long .LASF3
.uleb128 0x3
.byte 0x1
.byte 0x6
.long .LASF4
.uleb128 0x5
.byte 0x8
.byte 0x3
.byte 0xa
.long 0xb4
.uleb128 0x6
.long .LASF5
.byte 0x3
.byte 0xb
.long 0x3e
.byte 0
.uleb128 0x7
.string "sel"
.byte 0x3
.byte 0xc
.long 0x3e
.byte 0x2
.uleb128 0x6
.long .LASF6
.byte 0x3
.byte 0xd
.long 0x57
.byte 0x4
.uleb128 0x6
.long .LASF7
.byte 0x3
.byte 0x13
.long 0x57
.byte 0x5
.uleb128 0x6
.long .LASF8
.byte 0x3
.byte 0x14
.long 0x3e
.byte 0x6
.byte 0
.uleb128 0x8
.long .LASF9
.byte 0x3
.byte 0x15
.long 0x6f
.uleb128 0x5
.byte 0x6
.byte 0x3
.byte 0x19
.long 0xe0
.uleb128 0x6
.long .LASF10
.byte 0x3
.byte 0x1a
.long 0x3e
.byte 0
.uleb128 0x6
.long .LASF11
.byte 0x3
.byte 0x1b
.long 0x25
.byte 0x2
.byte 0
.uleb128 0x8
.long .LASF12
.byte 0x3
.byte 0x1c
.long 0xbf
.uleb128 0x9
.long .LASF25
.byte 0x14
.byte 0x4
.byte 0x9
.long 0x133
.uleb128 0x7
.string "id"
.byte 0x4
.byte 0xa
.long 0x25
.byte 0
.uleb128 0x6
.long .LASF11
.byte 0x4
.byte 0xb
.long 0x25
.byte 0x4
.uleb128 0x6
.long .LASF13
.byte 0x4
.byte 0xc
.long 0x25
.byte 0x8
.uleb128 0x6
.long .LASF14
.byte 0x4
.byte 0xd
.long 0x133
.byte 0xc
.uleb128 0x6
.long .LASF15
.byte 0x4
.byte 0xe
.long 0x133
.byte 0x10
.byte 0
.uleb128 0xa
.byte 0x4
.long 0xeb
.uleb128 0x8
.long .LASF16
.byte 0x4
.byte 0xf
.long 0xeb
.uleb128 0xb
.long .LASF18
.byte 0x1
.byte 0x11
.long .LFB0
.long .LFE0-.LFB0
.uleb128 0x1
.byte 0x9c
.long 0x174
.uleb128 0xc
.string "pid"
.byte 0x1
.byte 0x13
.long 0x37
.uleb128 0x2
.byte 0x91
.sleb128 -20
.uleb128 0xc
.string "c"
.byte 0x1
.byte 0x14
.long 0x174
.uleb128 0x2
.byte 0x91
.sleb128 -36
.byte 0
.uleb128 0xd
.long 0x68
.long 0x184
.uleb128 0xe
.long 0x184
.byte 0xf
.byte 0
.uleb128 0x3
.byte 0x4
.byte 0x7
.long .LASF17
.uleb128 0xb
.long .LASF19
.byte 0x1
.byte 0x1c
.long .LFB1
.long .LFE1-.LFB1
.uleb128 0x1
.byte 0x9c
.long 0x1df
.uleb128 0xf
.long .LASF26
.byte 0x1
.byte 0x1c
.long 0x1df
.uleb128 0x2
.byte 0x91
.sleb128 0
.uleb128 0x10
.long .LBB2
.long .LBE2-.LBB2
.uleb128 0xc
.string "n0"
.byte 0x1
.byte 0x21
.long 0x1e5
.uleb128 0x2
.byte 0x91
.sleb128 -20
.uleb128 0xc
.string "n1"
.byte 0x1
.byte 0x22
.long 0x1eb
.uleb128 0x2
.byte 0x91
.sleb128 -24
.uleb128 0xc
.string "c"
.byte 0x1
.byte 0x2a
.long 0x174
.uleb128 0x2
.byte 0x91
.sleb128 -40
.byte 0
.byte 0
.uleb128 0xa
.byte 0x4
.long 0x68
.uleb128 0xa
.byte 0x4
.long 0x25
.uleb128 0xa
.byte 0x4
.long 0x139
.uleb128 0x11
.long .LASF20
.byte 0x5
.byte 0x6
.long 0x25
.uleb128 0xd
.long 0xb4
.long 0x20c
.uleb128 0xe
.long 0x184
.byte 0xff
.byte 0
.uleb128 0x12
.string "idt"
.byte 0x3
.byte 0x1f
.long 0x1fc
.uleb128 0x5
.byte 0x3
.long idt
.uleb128 0x13
.long .LASF21
.byte 0x3
.byte 0x20
.long 0xe0
.uleb128 0x5
.byte 0x3
.long idt_reg
.byte 0
.section .debug_abbrev,"",@progbits
.Ldebug_abbrev0:
.uleb128 0x1
.uleb128 0x11
.byte 0x1
.uleb128 0x25
.uleb128 0xe
.uleb128 0x13
.uleb128 0xb
.uleb128 0x3
.uleb128 0xe
.uleb128 0x1b
.uleb128 0xe
.uleb128 0x11
.uleb128 0x1
.uleb128 0x12
.uleb128 0x6
.uleb128 0x10
.uleb128 0x17
.byte 0
.byte 0
.uleb128 0x2
.uleb128 0x16
.byte 0
.uleb128 0x3
.uleb128 0x8
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.byte 0
.byte 0
.uleb128 0x3
.uleb128 0x24
.byte 0
.uleb128 0xb
.uleb128 0xb
.uleb128 0x3e
.uleb128 0xb
.uleb128 0x3
.uleb128 0xe
.byte 0
.byte 0
.uleb128 0x4
.uleb128 0x24
.byte 0
.uleb128 0xb
.uleb128 0xb
.uleb128 0x3e
.uleb128 0xb
.uleb128 0x3
.uleb128 0x8
.byte 0
.byte 0
.uleb128 0x5
.uleb128 0x13
.byte 0x1
.uleb128 0xb
.uleb128 0xb
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x1
.uleb128 0x13
.byte 0
.byte 0
.uleb128 0x6
.uleb128 0xd
.byte 0
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.uleb128 0x38
.uleb128 0xb
.byte 0
.byte 0
.uleb128 0x7
.uleb128 0xd
.byte 0
.uleb128 0x3
.uleb128 0x8
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.uleb128 0x38
.uleb128 0xb
.byte 0
.byte 0
.uleb128 0x8
.uleb128 0x16
.byte 0
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.byte 0
.byte 0
.uleb128 0x9
.uleb128 0x13
.byte 0x1
.uleb128 0x3
.uleb128 0xe
.uleb128 0xb
.uleb128 0xb
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x1
.uleb128 0x13
.byte 0
.byte 0
.uleb128 0xa
.uleb128 0xf
.byte 0
.uleb128 0xb
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.byte 0
.byte 0
.uleb128 0xb
.uleb128 0x2e
.byte 0x1
.uleb128 0x3f
.uleb128 0x19
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x27
.uleb128 0x19
.uleb128 0x11
.uleb128 0x1
.uleb128 0x12
.uleb128 0x6
.uleb128 0x40
.uleb128 0x18
.uleb128 0x2116
.uleb128 0x19
.uleb128 0x1
.uleb128 0x13
.byte 0
.byte 0
.uleb128 0xc
.uleb128 0x34
.byte 0
.uleb128 0x3
.uleb128 0x8
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.uleb128 0x2
.uleb128 0x18
.byte 0
.byte 0
.uleb128 0xd
.uleb128 0x1
.byte 0x1
.uleb128 0x49
.uleb128 0x13
.uleb128 0x1
.uleb128 0x13
.byte 0
.byte 0
.uleb128 0xe
.uleb128 0x21
.byte 0
.uleb128 0x49
.uleb128 0x13
.uleb128 0x2f
.uleb128 0xb
.byte 0
.byte 0
.uleb128 0xf
.uleb128 0x5
.byte 0
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.uleb128 0x2
.uleb128 0x18
.byte 0
.byte 0
.uleb128 0x10
.uleb128 0xb
.byte 0x1
.uleb128 0x11
.uleb128 0x1
.uleb128 0x12
.uleb128 0x6
.byte 0
.byte 0
.uleb128 0x11
.uleb128 0x34
.byte 0
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.uleb128 0x3f
.uleb128 0x19
.uleb128 0x3c
.uleb128 0x19
.byte 0
.byte 0
.uleb128 0x12
.uleb128 0x34
.byte 0
.uleb128 0x3
.uleb128 0x8
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.uleb128 0x3f
.uleb128 0x19
.uleb128 0x2
.uleb128 0x18
.byte 0
.byte 0
.uleb128 0x13
.uleb128 0x34
.byte 0
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.uleb128 0x3f
.uleb128 0x19
.uleb128 0x2
.uleb128 0x18
.byte 0
.byte 0
.byte 0
.section .debug_aranges,"",@progbits
.long 0x1c
.value 0x2
.long .Ldebug_info0
.byte 0x4
.byte 0
.value 0
.value 0
.long .Ltext0
.long .Letext0-.Ltext0
.long 0
.long 0
.section .debug_line,"",@progbits
.Ldebug_line0:
.section .debug_str,"MS",@progbits,1
.LASF5:
.string "low_offset"
.LASF9:
.string "idt_gate_t"
.LASF14:
.string "next"
.LASF23:
.string "hello.c"
.LASF21:
.string "idt_reg"
.LASF19:
.string "user_input"
.LASF15:
.string "previous"
.LASF3:
.string "unsigned char"
.LASF11:
.string "base"
.LASF1:
.string "short unsigned int"
.LASF25:
.string "_node"
.LASF6:
.string "always0"
.LASF0:
.string "unsigned int"
.LASF7:
.string "flags"
.LASF26:
.string "input"
.LASF4:
.string "char"
.LASF22:
.string "GNU C11 5.4.0 20160609 -m32 -mtune=generic -march=i686 -g -fno-pie -ffreestanding -fno-builtin -fno-stack-protector"
.LASF10:
.string "limit"
.LASF17:
.string "sizetype"
.LASF24:
.string "/home/os/OS_Project/Part4/10_scheduler"
.LASF20:
.string "global_id"
.LASF2:
.string "short int"
.LASF18:
.string "start_"
.LASF16:
.string "node"
.LASF8:
.string "high_offset"
.LASF12:
.string "idt_register_t"
.LASF13:
.string "size"
.ident "GCC: (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609"
.section .note.GNU-stack,"",@progbits

560
Part4/10_scheduler/idt.s Normal file
View File

@ -0,0 +1,560 @@
.file "idt.c"
.text
.Ltext0:
.comm idt,2048,32
.comm idt_reg,6,4
.globl set_idt_gate
.type set_idt_gate, @function
set_idt_gate:
.LFB0:
.file 1 "./cpu/idt.c"
.loc 1 3 0
.cfi_startproc
pushl %ebp
.cfi_def_cfa_offset 8
.cfi_offset 5, -8
movl %esp, %ebp
.cfi_def_cfa_register 5
.loc 1 4 0
movl 12(%ebp), %eax
movl %eax, %edx
movl 8(%ebp), %eax
movw %dx, idt(,%eax,8)
.loc 1 5 0
movl 8(%ebp), %eax
movw $8, idt+2(,%eax,8)
.loc 1 6 0
movl 8(%ebp), %eax
movb $0, idt+4(,%eax,8)
.loc 1 7 0
movl 8(%ebp), %eax
movb $-114, idt+5(,%eax,8)
.loc 1 8 0
movl 12(%ebp), %eax
shrl $16, %eax
movl %eax, %edx
movl 8(%ebp), %eax
movw %dx, idt+6(,%eax,8)
.loc 1 9 0
nop
popl %ebp
.cfi_restore 5
.cfi_def_cfa 4, 4
ret
.cfi_endproc
.LFE0:
.size set_idt_gate, .-set_idt_gate
.globl set_idt
.type set_idt, @function
set_idt:
.LFB1:
.loc 1 11 0
.cfi_startproc
pushl %ebp
.cfi_def_cfa_offset 8
.cfi_offset 5, -8
movl %esp, %ebp
.cfi_def_cfa_register 5
.loc 1 12 0
movl $idt, %eax
movl %eax, idt_reg+2
.loc 1 13 0
movw $2047, idt_reg
.loc 1 15 0
movl $idt_reg, %eax
#APP
# 15 "./cpu/idt.c" 1
lidtl (%eax)
# 0 "" 2
.loc 1 16 0
#NO_APP
nop
popl %ebp
.cfi_restore 5
.cfi_def_cfa 4, 4
ret
.cfi_endproc
.LFE1:
.size set_idt, .-set_idt
.Letext0:
.file 2 "./cpu/types.h"
.file 3 "./cpu/idt.h"
.section .debug_info,"",@progbits
.Ldebug_info0:
.long 0x162
.value 0x4
.long .Ldebug_abbrev0
.byte 0x4
.uleb128 0x1
.long .LASF16
.byte 0xc
.long .LASF17
.long .LASF18
.long .Ltext0
.long .Letext0-.Ltext0
.long .Ldebug_line0
.uleb128 0x2
.string "u32"
.byte 0x2
.byte 0x6
.long 0x30
.uleb128 0x3
.byte 0x4
.byte 0x7
.long .LASF0
.uleb128 0x4
.byte 0x4
.byte 0x5
.string "int"
.uleb128 0x2
.string "u16"
.byte 0x2
.byte 0x8
.long 0x49
.uleb128 0x3
.byte 0x2
.byte 0x7
.long .LASF1
.uleb128 0x3
.byte 0x2
.byte 0x5
.long .LASF2
.uleb128 0x2
.string "u8"
.byte 0x2
.byte 0xa
.long 0x61
.uleb128 0x3
.byte 0x1
.byte 0x8
.long .LASF3
.uleb128 0x3
.byte 0x1
.byte 0x6
.long .LASF4
.uleb128 0x5
.byte 0x8
.byte 0x3
.byte 0xa
.long 0xb4
.uleb128 0x6
.long .LASF5
.byte 0x3
.byte 0xb
.long 0x3e
.byte 0
.uleb128 0x7
.string "sel"
.byte 0x3
.byte 0xc
.long 0x3e
.byte 0x2
.uleb128 0x6
.long .LASF6
.byte 0x3
.byte 0xd
.long 0x57
.byte 0x4
.uleb128 0x6
.long .LASF7
.byte 0x3
.byte 0x13
.long 0x57
.byte 0x5
.uleb128 0x6
.long .LASF8
.byte 0x3
.byte 0x14
.long 0x3e
.byte 0x6
.byte 0
.uleb128 0x8
.long .LASF9
.byte 0x3
.byte 0x15
.long 0x6f
.uleb128 0x5
.byte 0x6
.byte 0x3
.byte 0x19
.long 0xe0
.uleb128 0x6
.long .LASF10
.byte 0x3
.byte 0x1a
.long 0x3e
.byte 0
.uleb128 0x6
.long .LASF11
.byte 0x3
.byte 0x1b
.long 0x25
.byte 0x2
.byte 0
.uleb128 0x8
.long .LASF12
.byte 0x3
.byte 0x1c
.long 0xbf
.uleb128 0x9
.long .LASF19
.byte 0x1
.byte 0x3
.long .LFB0
.long .LFE0-.LFB0
.uleb128 0x1
.byte 0x9c
.long 0x11b
.uleb128 0xa
.string "n"
.byte 0x1
.byte 0x3
.long 0x37
.uleb128 0x2
.byte 0x91
.sleb128 0
.uleb128 0xb
.long .LASF13
.byte 0x1
.byte 0x3
.long 0x25
.uleb128 0x2
.byte 0x91
.sleb128 4
.byte 0
.uleb128 0xc
.long .LASF20
.byte 0x1
.byte 0xb
.long .LFB1
.long .LFE1-.LFB1
.uleb128 0x1
.byte 0x9c
.uleb128 0xd
.long 0xb4
.long 0x13c
.uleb128 0xe
.long 0x13c
.byte 0xff
.byte 0
.uleb128 0x3
.byte 0x4
.byte 0x7
.long .LASF14
.uleb128 0xf
.string "idt"
.byte 0x3
.byte 0x1f
.long 0x12c
.uleb128 0x5
.byte 0x3
.long idt
.uleb128 0x10
.long .LASF15
.byte 0x3
.byte 0x20
.long 0xe0
.uleb128 0x5
.byte 0x3
.long idt_reg
.byte 0
.section .debug_abbrev,"",@progbits
.Ldebug_abbrev0:
.uleb128 0x1
.uleb128 0x11
.byte 0x1
.uleb128 0x25
.uleb128 0xe
.uleb128 0x13
.uleb128 0xb
.uleb128 0x3
.uleb128 0xe
.uleb128 0x1b
.uleb128 0xe
.uleb128 0x11
.uleb128 0x1
.uleb128 0x12
.uleb128 0x6
.uleb128 0x10
.uleb128 0x17
.byte 0
.byte 0
.uleb128 0x2
.uleb128 0x16
.byte 0
.uleb128 0x3
.uleb128 0x8
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.byte 0
.byte 0
.uleb128 0x3
.uleb128 0x24
.byte 0
.uleb128 0xb
.uleb128 0xb
.uleb128 0x3e
.uleb128 0xb
.uleb128 0x3
.uleb128 0xe
.byte 0
.byte 0
.uleb128 0x4
.uleb128 0x24
.byte 0
.uleb128 0xb
.uleb128 0xb
.uleb128 0x3e
.uleb128 0xb
.uleb128 0x3
.uleb128 0x8
.byte 0
.byte 0
.uleb128 0x5
.uleb128 0x13
.byte 0x1
.uleb128 0xb
.uleb128 0xb
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x1
.uleb128 0x13
.byte 0
.byte 0
.uleb128 0x6
.uleb128 0xd
.byte 0
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.uleb128 0x38
.uleb128 0xb
.byte 0
.byte 0
.uleb128 0x7
.uleb128 0xd
.byte 0
.uleb128 0x3
.uleb128 0x8
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.uleb128 0x38
.uleb128 0xb
.byte 0
.byte 0
.uleb128 0x8
.uleb128 0x16
.byte 0
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.byte 0
.byte 0
.uleb128 0x9
.uleb128 0x2e
.byte 0x1
.uleb128 0x3f
.uleb128 0x19
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x27
.uleb128 0x19
.uleb128 0x11
.uleb128 0x1
.uleb128 0x12
.uleb128 0x6
.uleb128 0x40
.uleb128 0x18
.uleb128 0x2117
.uleb128 0x19
.uleb128 0x1
.uleb128 0x13
.byte 0
.byte 0
.uleb128 0xa
.uleb128 0x5
.byte 0
.uleb128 0x3
.uleb128 0x8
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.uleb128 0x2
.uleb128 0x18
.byte 0
.byte 0
.uleb128 0xb
.uleb128 0x5
.byte 0
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.uleb128 0x2
.uleb128 0x18
.byte 0
.byte 0
.uleb128 0xc
.uleb128 0x2e
.byte 0
.uleb128 0x3f
.uleb128 0x19
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x11
.uleb128 0x1
.uleb128 0x12
.uleb128 0x6
.uleb128 0x40
.uleb128 0x18
.uleb128 0x2117
.uleb128 0x19
.byte 0
.byte 0
.uleb128 0xd
.uleb128 0x1
.byte 0x1
.uleb128 0x49
.uleb128 0x13
.uleb128 0x1
.uleb128 0x13
.byte 0
.byte 0
.uleb128 0xe
.uleb128 0x21
.byte 0
.uleb128 0x49
.uleb128 0x13
.uleb128 0x2f
.uleb128 0xb
.byte 0
.byte 0
.uleb128 0xf
.uleb128 0x34
.byte 0
.uleb128 0x3
.uleb128 0x8
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.uleb128 0x3f
.uleb128 0x19
.uleb128 0x2
.uleb128 0x18
.byte 0
.byte 0
.uleb128 0x10
.uleb128 0x34
.byte 0
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.uleb128 0x3f
.uleb128 0x19
.uleb128 0x2
.uleb128 0x18
.byte 0
.byte 0
.byte 0
.section .debug_aranges,"",@progbits
.long 0x1c
.value 0x2
.long .Ldebug_info0
.byte 0x4
.byte 0
.value 0
.value 0
.long .Ltext0
.long .Letext0-.Ltext0
.long 0
.long 0
.section .debug_line,"",@progbits
.Ldebug_line0:
.section .debug_str,"MS",@progbits,1
.LASF8:
.string "high_offset"
.LASF0:
.string "unsigned int"
.LASF17:
.string "./cpu/idt.c"
.LASF7:
.string "flags"
.LASF9:
.string "idt_gate_t"
.LASF13:
.string "handler"
.LASF18:
.string "/home/os/OS_Project/Part4/10_scheduler"
.LASF10:
.string "limit"
.LASF12:
.string "idt_register_t"
.LASF11:
.string "base"
.LASF6:
.string "always0"
.LASF4:
.string "char"
.LASF19:
.string "set_idt_gate"
.LASF5:
.string "low_offset"
.LASF16:
.string "GNU C11 5.4.0 20160609 -m32 -mtune=generic -march=i686 -g -fno-pie -ffreestanding -fno-builtin -fno-stack-protector"
.LASF1:
.string "short unsigned int"
.LASF3:
.string "unsigned char"
.LASF2:
.string "short int"
.LASF15:
.string "idt_reg"
.LASF20:
.string "set_idt"
.LASF14:
.string "sizetype"
.ident "GCC: (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609"
.section .note.GNU-stack,"",@progbits

Binary file not shown.

1518
Part4/10_scheduler/isr.s Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,965 @@
.file "keyboard.c"
.text
.Ltext0:
.local key_buffer
.comm key_buffer,256,32
.globl sc_name
.section .rodata
.LC0:
.string "ERROR"
.LC1:
.string "Esc"
.LC2:
.string "1"
.LC3:
.string "2"
.LC4:
.string "3"
.LC5:
.string "4"
.LC6:
.string "5"
.LC7:
.string "6"
.LC8:
.string "7"
.LC9:
.string "8"
.LC10:
.string "9"
.LC11:
.string "0"
.LC12:
.string "-"
.LC13:
.string "="
.LC14:
.string "Backspace"
.LC15:
.string "Tab"
.LC16:
.string "Q"
.LC17:
.string "W"
.LC18:
.string "E"
.LC19:
.string "R"
.LC20:
.string "T"
.LC21:
.string "Y"
.LC22:
.string "U"
.LC23:
.string "I"
.LC24:
.string "O"
.LC25:
.string "P"
.LC26:
.string "["
.LC27:
.string "]"
.LC28:
.string "Enter"
.LC29:
.string "Lctrl"
.LC30:
.string "A"
.LC31:
.string "S"
.LC32:
.string "D"
.LC33:
.string "F"
.LC34:
.string "G"
.LC35:
.string "H"
.LC36:
.string "J"
.LC37:
.string "K"
.LC38:
.string "L"
.LC39:
.string ";"
.LC40:
.string "'"
.LC41:
.string "`"
.LC42:
.string "LShift"
.LC43:
.string "\\"
.LC44:
.string "Z"
.LC45:
.string "X"
.LC46:
.string "C"
.LC47:
.string "V"
.LC48:
.string "B"
.LC49:
.string "N"
.LC50:
.string "M"
.LC51:
.string ","
.LC52:
.string "."
.LC53:
.string "/"
.LC54:
.string "RShift"
.LC55:
.string "Keypad *"
.LC56:
.string "LAlt"
.LC57:
.string "Spacebar"
.data
.align 32
.type sc_name, @object
.size sc_name, 232
sc_name:
.long .LC0
.long .LC1
.long .LC2
.long .LC3
.long .LC4
.long .LC5
.long .LC6
.long .LC7
.long .LC8
.long .LC9
.long .LC10
.long .LC11
.long .LC12
.long .LC13
.long .LC14
.long .LC15
.long .LC16
.long .LC17
.long .LC18
.long .LC19
.long .LC20
.long .LC21
.long .LC22
.long .LC23
.long .LC24
.long .LC25
.long .LC26
.long .LC27
.long .LC28
.long .LC29
.long .LC30
.long .LC31
.long .LC32
.long .LC33
.long .LC34
.long .LC35
.long .LC36
.long .LC37
.long .LC38
.long .LC39
.long .LC40
.long .LC41
.long .LC42
.long .LC43
.long .LC44
.long .LC45
.long .LC46
.long .LC47
.long .LC48
.long .LC49
.long .LC50
.long .LC51
.long .LC52
.long .LC53
.long .LC54
.long .LC55
.long .LC56
.long .LC57
.globl sc_ascii
.section .rodata
.align 32
.type sc_ascii, @object
.size sc_ascii, 58
sc_ascii:
.byte 63
.byte 63
.byte 49
.byte 50
.byte 51
.byte 52
.byte 53
.byte 54
.byte 55
.byte 56
.byte 57
.byte 48
.byte 45
.byte 61
.byte 63
.byte 63
.byte 81
.byte 87
.byte 69
.byte 82
.byte 84
.byte 89
.byte 85
.byte 73
.byte 79
.byte 80
.byte 91
.byte 93
.byte 63
.byte 63
.byte 65
.byte 83
.byte 68
.byte 70
.byte 71
.byte 72
.byte 74
.byte 75
.byte 76
.byte 59
.byte 39
.byte 96
.byte 63
.byte 92
.byte 90
.byte 88
.byte 67
.byte 86
.byte 66
.byte 78
.byte 77
.byte 44
.byte 46
.byte 47
.byte 63
.byte 63
.byte 63
.byte 32
.LC58:
.string "\n"
.text
.type keyboard_callback, @function
keyboard_callback:
.LFB0:
.file 1 "./drivers/keyboard.c"
.loc 1 27 0
.cfi_startproc
pushl %ebp
.cfi_def_cfa_offset 8
.cfi_offset 5, -8
movl %esp, %ebp
.cfi_def_cfa_register 5
subl $24, %esp
.loc 1 29 0
subl $12, %esp
pushl $96
call port_byte_in
addl $16, %esp
movb %al, -9(%ebp)
.loc 1 31 0
cmpb $57, -9(%ebp)
ja .L6
.loc 1 32 0
cmpb $14, -9(%ebp)
jne .L4
.loc 1 33 0
subl $12, %esp
pushl $key_buffer
call backspace
addl $16, %esp
.loc 1 34 0
call kprint_backspace
jmp .L1
.L4:
.loc 1 35 0
cmpb $28, -9(%ebp)
jne .L5
.loc 1 36 0
subl $12, %esp
pushl $.LC58
call kprint
addl $16, %esp
.loc 1 37 0
subl $12, %esp
pushl $key_buffer
call user_input
addl $16, %esp
.loc 1 38 0
movb $0, key_buffer
jmp .L1
.L5:
.LBB2:
.loc 1 40 0 discriminator 2
movzbl -9(%ebp), %eax
movzbl sc_ascii(%eax), %eax
movb %al, -10(%ebp)
.loc 1 42 0 discriminator 2
movzbl -10(%ebp), %eax
movb %al, -12(%ebp)
movb $0, -11(%ebp)
.loc 1 43 0 discriminator 2
movsbl -10(%ebp), %eax
subl $8, %esp
pushl %eax
pushl $key_buffer
call append
addl $16, %esp
.loc 1 44 0 discriminator 2
subl $12, %esp
leal -12(%ebp), %eax
pushl %eax
call kprint
addl $16, %esp
jmp .L1
.L6:
.LBE2:
.loc 1 31 0
nop
.L1:
.loc 1 47 0
leave
.cfi_restore 5
.cfi_def_cfa 4, 4
ret
.cfi_endproc
.LFE0:
.size keyboard_callback, .-keyboard_callback
.globl init_keyboard
.type init_keyboard, @function
init_keyboard:
.LFB1:
.loc 1 49 0
.cfi_startproc
pushl %ebp
.cfi_def_cfa_offset 8
.cfi_offset 5, -8
movl %esp, %ebp
.cfi_def_cfa_register 5
subl $8, %esp
.loc 1 50 0
subl $8, %esp
pushl $keyboard_callback
pushl $33
call register_interrupt_handler
addl $16, %esp
.loc 1 51 0
nop
leave
.cfi_restore 5
.cfi_def_cfa 4, 4
ret
.cfi_endproc
.LFE1:
.size init_keyboard, .-init_keyboard
.Letext0:
.file 2 "./drivers/../cpu/types.h"
.file 3 "./drivers/../cpu/isr.h"
.section .debug_info,"",@progbits
.Ldebug_info0:
.long 0x225
.value 0x4
.long .Ldebug_abbrev0
.byte 0x4
.uleb128 0x1
.long .LASF16
.byte 0xc
.long .LASF17
.long .LASF18
.long .Ltext0
.long .Letext0-.Ltext0
.long .Ldebug_line0
.uleb128 0x2
.string "u32"
.byte 0x2
.byte 0x6
.long 0x30
.uleb128 0x3
.byte 0x4
.byte 0x7
.long .LASF0
.uleb128 0x4
.byte 0x4
.byte 0x5
.string "int"
.uleb128 0x3
.byte 0x2
.byte 0x7
.long .LASF1
.uleb128 0x3
.byte 0x2
.byte 0x5
.long .LASF2
.uleb128 0x2
.string "u8"
.byte 0x2
.byte 0xa
.long 0x56
.uleb128 0x3
.byte 0x1
.byte 0x8
.long .LASF3
.uleb128 0x3
.byte 0x1
.byte 0x6
.long .LASF4
.uleb128 0x5
.byte 0x40
.byte 0x3
.byte 0x4b
.long 0x12a
.uleb128 0x6
.string "ds"
.byte 0x3
.byte 0x4c
.long 0x25
.byte 0
.uleb128 0x6
.string "edi"
.byte 0x3
.byte 0x4d
.long 0x25
.byte 0x4
.uleb128 0x6
.string "esi"
.byte 0x3
.byte 0x4d
.long 0x25
.byte 0x8
.uleb128 0x6
.string "ebp"
.byte 0x3
.byte 0x4d
.long 0x25
.byte 0xc
.uleb128 0x6
.string "esp"
.byte 0x3
.byte 0x4d
.long 0x25
.byte 0x10
.uleb128 0x6
.string "ebx"
.byte 0x3
.byte 0x4d
.long 0x25
.byte 0x14
.uleb128 0x6
.string "edx"
.byte 0x3
.byte 0x4d
.long 0x25
.byte 0x18
.uleb128 0x6
.string "ecx"
.byte 0x3
.byte 0x4d
.long 0x25
.byte 0x1c
.uleb128 0x6
.string "eax"
.byte 0x3
.byte 0x4d
.long 0x25
.byte 0x20
.uleb128 0x7
.long .LASF5
.byte 0x3
.byte 0x4e
.long 0x25
.byte 0x24
.uleb128 0x7
.long .LASF6
.byte 0x3
.byte 0x4e
.long 0x25
.byte 0x28
.uleb128 0x6
.string "eip"
.byte 0x3
.byte 0x4f
.long 0x25
.byte 0x2c
.uleb128 0x6
.string "cs"
.byte 0x3
.byte 0x4f
.long 0x25
.byte 0x30
.uleb128 0x7
.long .LASF7
.byte 0x3
.byte 0x4f
.long 0x25
.byte 0x34
.uleb128 0x7
.long .LASF8
.byte 0x3
.byte 0x4f
.long 0x25
.byte 0x38
.uleb128 0x6
.string "ss"
.byte 0x3
.byte 0x4f
.long 0x25
.byte 0x3c
.byte 0
.uleb128 0x8
.long .LASF9
.byte 0x3
.byte 0x50
.long 0x64
.uleb128 0x9
.long .LASF19
.byte 0x1
.byte 0x1b
.long .LFB0
.long .LFE0-.LFB0
.uleb128 0x1
.byte 0x9c
.long 0x18d
.uleb128 0xa
.long .LASF20
.byte 0x1
.byte 0x1b
.long 0x12a
.uleb128 0x2
.byte 0x91
.sleb128 0
.uleb128 0xb
.long .LASF10
.byte 0x1
.byte 0x1d
.long 0x4c
.uleb128 0x2
.byte 0x91
.sleb128 -17
.uleb128 0xc
.long .LBB2
.long .LBE2-.LBB2
.uleb128 0xb
.long .LASF11
.byte 0x1
.byte 0x28
.long 0x5d
.uleb128 0x2
.byte 0x91
.sleb128 -18
.uleb128 0xd
.string "str"
.byte 0x1
.byte 0x2a
.long 0x18d
.uleb128 0x2
.byte 0x91
.sleb128 -20
.byte 0
.byte 0
.uleb128 0xe
.long 0x5d
.long 0x19d
.uleb128 0xf
.long 0x19d
.byte 0x1
.byte 0
.uleb128 0x3
.byte 0x4
.byte 0x7
.long .LASF12
.uleb128 0x10
.long .LASF21
.byte 0x1
.byte 0x31
.long .LFB1
.long .LFE1-.LFB1
.uleb128 0x1
.byte 0x9c
.uleb128 0xe
.long 0x5d
.long 0x1c5
.uleb128 0xf
.long 0x19d
.byte 0xff
.byte 0
.uleb128 0xb
.long .LASF13
.byte 0x1
.byte 0xc
.long 0x1b5
.uleb128 0x5
.byte 0x3
.long key_buffer
.uleb128 0xe
.long 0x1e6
.long 0x1e6
.uleb128 0xf
.long 0x19d
.byte 0x39
.byte 0
.uleb128 0x11
.byte 0x4
.long 0x1ec
.uleb128 0x12
.long 0x5d
.uleb128 0x13
.long .LASF14
.byte 0x1
.byte 0xf
.long 0x1d6
.uleb128 0x5
.byte 0x3
.long sc_name
.uleb128 0xe
.long 0x1ec
.long 0x212
.uleb128 0xf
.long 0x19d
.byte 0x39
.byte 0
.uleb128 0x13
.long .LASF15
.byte 0x1
.byte 0x15
.long 0x223
.uleb128 0x5
.byte 0x3
.long sc_ascii
.uleb128 0x12
.long 0x202
.byte 0
.section .debug_abbrev,"",@progbits
.Ldebug_abbrev0:
.uleb128 0x1
.uleb128 0x11
.byte 0x1
.uleb128 0x25
.uleb128 0xe
.uleb128 0x13
.uleb128 0xb
.uleb128 0x3
.uleb128 0xe
.uleb128 0x1b
.uleb128 0xe
.uleb128 0x11
.uleb128 0x1
.uleb128 0x12
.uleb128 0x6
.uleb128 0x10
.uleb128 0x17
.byte 0
.byte 0
.uleb128 0x2
.uleb128 0x16
.byte 0
.uleb128 0x3
.uleb128 0x8
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.byte 0
.byte 0
.uleb128 0x3
.uleb128 0x24
.byte 0
.uleb128 0xb
.uleb128 0xb
.uleb128 0x3e
.uleb128 0xb
.uleb128 0x3
.uleb128 0xe
.byte 0
.byte 0
.uleb128 0x4
.uleb128 0x24
.byte 0
.uleb128 0xb
.uleb128 0xb
.uleb128 0x3e
.uleb128 0xb
.uleb128 0x3
.uleb128 0x8
.byte 0
.byte 0
.uleb128 0x5
.uleb128 0x13
.byte 0x1
.uleb128 0xb
.uleb128 0xb
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x1
.uleb128 0x13
.byte 0
.byte 0
.uleb128 0x6
.uleb128 0xd
.byte 0
.uleb128 0x3
.uleb128 0x8
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.uleb128 0x38
.uleb128 0xb
.byte 0
.byte 0
.uleb128 0x7
.uleb128 0xd
.byte 0
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.uleb128 0x38
.uleb128 0xb
.byte 0
.byte 0
.uleb128 0x8
.uleb128 0x16
.byte 0
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.byte 0
.byte 0
.uleb128 0x9
.uleb128 0x2e
.byte 0x1
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x27
.uleb128 0x19
.uleb128 0x11
.uleb128 0x1
.uleb128 0x12
.uleb128 0x6
.uleb128 0x40
.uleb128 0x18
.uleb128 0x2116
.uleb128 0x19
.uleb128 0x1
.uleb128 0x13
.byte 0
.byte 0
.uleb128 0xa
.uleb128 0x5
.byte 0
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.uleb128 0x2
.uleb128 0x18
.byte 0
.byte 0
.uleb128 0xb
.uleb128 0x34
.byte 0
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.uleb128 0x2
.uleb128 0x18
.byte 0
.byte 0
.uleb128 0xc
.uleb128 0xb
.byte 0x1
.uleb128 0x11
.uleb128 0x1
.uleb128 0x12
.uleb128 0x6
.byte 0
.byte 0
.uleb128 0xd
.uleb128 0x34
.byte 0
.uleb128 0x3
.uleb128 0x8
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.uleb128 0x2
.uleb128 0x18
.byte 0
.byte 0
.uleb128 0xe
.uleb128 0x1
.byte 0x1
.uleb128 0x49
.uleb128 0x13
.uleb128 0x1
.uleb128 0x13
.byte 0
.byte 0
.uleb128 0xf
.uleb128 0x21
.byte 0
.uleb128 0x49
.uleb128 0x13
.uleb128 0x2f
.uleb128 0xb
.byte 0
.byte 0
.uleb128 0x10
.uleb128 0x2e
.byte 0
.uleb128 0x3f
.uleb128 0x19
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x11
.uleb128 0x1
.uleb128 0x12
.uleb128 0x6
.uleb128 0x40
.uleb128 0x18
.uleb128 0x2116
.uleb128 0x19
.byte 0
.byte 0
.uleb128 0x11
.uleb128 0xf
.byte 0
.uleb128 0xb
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.byte 0
.byte 0
.uleb128 0x12
.uleb128 0x26
.byte 0
.uleb128 0x49
.uleb128 0x13
.byte 0
.byte 0
.uleb128 0x13
.uleb128 0x34
.byte 0
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.uleb128 0x3f
.uleb128 0x19
.uleb128 0x2
.uleb128 0x18
.byte 0
.byte 0
.byte 0
.section .debug_aranges,"",@progbits
.long 0x1c
.value 0x2
.long .Ldebug_info0
.byte 0x4
.byte 0
.value 0
.value 0
.long .Ltext0
.long .Letext0-.Ltext0
.long 0
.long 0
.section .debug_line,"",@progbits
.Ldebug_line0:
.section .debug_str,"MS",@progbits,1
.LASF13:
.string "key_buffer"
.LASF10:
.string "scancode"
.LASF14:
.string "sc_name"
.LASF15:
.string "sc_ascii"
.LASF5:
.string "int_no"
.LASF8:
.string "useresp"
.LASF3:
.string "unsigned char"
.LASF1:
.string "short unsigned int"
.LASF17:
.string "./drivers/keyboard.c"
.LASF0:
.string "unsigned int"
.LASF4:
.string "char"
.LASF20:
.string "regs"
.LASF16:
.string "GNU C11 5.4.0 20160609 -m32 -mtune=generic -march=i686 -g -fno-pie -ffreestanding -fno-builtin -fno-stack-protector"
.LASF21:
.string "init_keyboard"
.LASF9:
.string "registers_t"
.LASF19:
.string "keyboard_callback"
.LASF7:
.string "eflags"
.LASF12:
.string "sizetype"
.LASF18:
.string "/home/os/OS_Project/Part4/10_scheduler"
.LASF6:
.string "err_code"
.LASF2:
.string "short int"
.LASF11:
.string "letter"
.ident "GCC: (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609"
.section .note.GNU-stack,"",@progbits

673
Part4/10_scheduler/mem.s Normal file
View File

@ -0,0 +1,673 @@
.file "mem.c"
.text
.Ltext0:
.globl memory_copy
.type memory_copy, @function
memory_copy:
.LFB0:
.file 1 "./libc/mem.c"
.loc 1 3 0
.cfi_startproc
pushl %ebp
.cfi_def_cfa_offset 8
.cfi_offset 5, -8
movl %esp, %ebp
.cfi_def_cfa_register 5
subl $16, %esp
.loc 1 5 0
movl $0, -4(%ebp)
jmp .L2
.L3:
.loc 1 6 0 discriminator 3
movl -4(%ebp), %edx
movl 12(%ebp), %eax
addl %eax, %edx
movl -4(%ebp), %ecx
movl 8(%ebp), %eax
addl %ecx, %eax
movzbl (%eax), %eax
movb %al, (%edx)
.loc 1 5 0 discriminator 3
addl $1, -4(%ebp)
.L2:
.loc 1 5 0 is_stmt 0 discriminator 1
movl -4(%ebp), %eax
cmpl 16(%ebp), %eax
jl .L3
.loc 1 8 0 is_stmt 1
nop
leave
.cfi_restore 5
.cfi_def_cfa 4, 4
ret
.cfi_endproc
.LFE0:
.size memory_copy, .-memory_copy
.globl memory_set
.type memory_set, @function
memory_set:
.LFB1:
.loc 1 10 0
.cfi_startproc
pushl %ebp
.cfi_def_cfa_offset 8
.cfi_offset 5, -8
movl %esp, %ebp
.cfi_def_cfa_register 5
subl $20, %esp
movl 12(%ebp), %eax
movb %al, -20(%ebp)
.loc 1 11 0
movl 8(%ebp), %eax
movl %eax, -4(%ebp)
.loc 1 12 0
jmp .L5
.L6:
.loc 1 12 0 is_stmt 0 discriminator 2
movl -4(%ebp), %eax
leal 1(%eax), %edx
movl %edx, -4(%ebp)
movzbl -20(%ebp), %edx
movb %dl, (%eax)
subl $1, 16(%ebp)
.L5:
.loc 1 12 0 discriminator 1
cmpl $0, 16(%ebp)
jne .L6
.loc 1 13 0 is_stmt 1
nop
leave
.cfi_restore 5
.cfi_def_cfa 4, 4
ret
.cfi_endproc
.LFE1:
.size memory_set, .-memory_set
.section .rodata
.LC0:
.string "Inside kmalloc phys_addr = "
.LC1:
.string "\n"
.text
.globl kmalloc
.type kmalloc, @function
kmalloc:
.LFB2:
.loc 1 18 0
.cfi_startproc
pushl %ebp
.cfi_def_cfa_offset 8
.cfi_offset 5, -8
movl %esp, %ebp
.cfi_def_cfa_register 5
subl $40, %esp
.loc 1 20 0
cmpl $1, 12(%ebp)
jne .L8
.loc 1 20 0 is_stmt 0 discriminator 1
movl free_mem_addr, %eax
andl $-4096, %eax
testl %eax, %eax
je .L8
.loc 1 21 0 is_stmt 1
movl free_mem_addr, %eax
andl $-4096, %eax
movl %eax, free_mem_addr
.loc 1 22 0
movl free_mem_addr, %eax
addl $4096, %eax
movl %eax, free_mem_addr
.L8:
.loc 1 27 0
movl 16(%ebp), %eax
movl (%eax), %eax
movl %eax, %edx
subl $8, %esp
leal -28(%ebp), %eax
pushl %eax
pushl %edx
call hex_to_ascii
addl $16, %esp
.loc 1 28 0
subl $12, %esp
pushl $.LC0
call kprint
addl $16, %esp
.loc 1 29 0
subl $12, %esp
leal -28(%ebp), %eax
pushl %eax
call kprint
addl $16, %esp
.loc 1 30 0
subl $12, %esp
pushl $.LC1
call kprint
addl $16, %esp
.loc 1 33 0
movl free_mem_addr, %edx
movl 16(%ebp), %eax
movl %edx, (%eax)
.loc 1 35 0
movl 16(%ebp), %eax
movl (%eax), %eax
movl %eax, %edx
subl $8, %esp
leal -28(%ebp), %eax
pushl %eax
pushl %edx
call hex_to_ascii
addl $16, %esp
.loc 1 36 0
subl $12, %esp
pushl $.LC0
call kprint
addl $16, %esp
.loc 1 37 0
subl $12, %esp
leal -28(%ebp), %eax
pushl %eax
call kprint
addl $16, %esp
.loc 1 38 0
subl $12, %esp
pushl $.LC1
call kprint
addl $16, %esp
.loc 1 40 0
movl free_mem_addr, %eax
movl %eax, -12(%ebp)
.loc 1 41 0
movl free_mem_addr, %edx
movl 8(%ebp), %eax
addl %edx, %eax
movl %eax, free_mem_addr
.loc 1 42 0
movl -12(%ebp), %eax
.loc 1 43 0
leave
.cfi_restore 5
.cfi_def_cfa 4, 4
ret
.cfi_endproc
.LFE2:
.size kmalloc, .-kmalloc
.Letext0:
.file 2 "./libc/../cpu/types.h"
.file 3 "./libc/globals.h"
.section .debug_info,"",@progbits
.Ldebug_info0:
.long 0x187
.value 0x4
.long .Ldebug_abbrev0
.byte 0x4
.uleb128 0x1
.long .LASF15
.byte 0xc
.long .LASF16
.long .LASF17
.long .Ltext0
.long .Letext0-.Ltext0
.long .Ldebug_line0
.uleb128 0x2
.string "u32"
.byte 0x2
.byte 0x6
.long 0x30
.uleb128 0x3
.byte 0x4
.byte 0x7
.long .LASF0
.uleb128 0x4
.byte 0x4
.byte 0x5
.string "int"
.uleb128 0x3
.byte 0x2
.byte 0x7
.long .LASF1
.uleb128 0x3
.byte 0x2
.byte 0x5
.long .LASF2
.uleb128 0x2
.string "u8"
.byte 0x2
.byte 0xa
.long 0x56
.uleb128 0x3
.byte 0x1
.byte 0x8
.long .LASF3
.uleb128 0x3
.byte 0x1
.byte 0x6
.long .LASF4
.uleb128 0x5
.long .LASF8
.byte 0x1
.byte 0x3
.long .LFB0
.long .LFE0-.LFB0
.uleb128 0x1
.byte 0x9c
.long 0xb0
.uleb128 0x6
.long .LASF5
.byte 0x1
.byte 0x3
.long 0xb0
.uleb128 0x2
.byte 0x91
.sleb128 0
.uleb128 0x6
.long .LASF6
.byte 0x1
.byte 0x3
.long 0xb0
.uleb128 0x2
.byte 0x91
.sleb128 4
.uleb128 0x6
.long .LASF7
.byte 0x1
.byte 0x3
.long 0x37
.uleb128 0x2
.byte 0x91
.sleb128 8
.uleb128 0x7
.string "i"
.byte 0x1
.byte 0x4
.long 0x37
.uleb128 0x2
.byte 0x91
.sleb128 -12
.byte 0
.uleb128 0x8
.byte 0x4
.long 0x4c
.uleb128 0x5
.long .LASF9
.byte 0x1
.byte 0xa
.long .LFB1
.long .LFE1-.LFB1
.uleb128 0x1
.byte 0x9c
.long 0x104
.uleb128 0x6
.long .LASF6
.byte 0x1
.byte 0xa
.long 0xb0
.uleb128 0x2
.byte 0x91
.sleb128 0
.uleb128 0x9
.string "val"
.byte 0x1
.byte 0xa
.long 0x4c
.uleb128 0x2
.byte 0x91
.sleb128 -28
.uleb128 0x9
.string "len"
.byte 0x1
.byte 0xa
.long 0x25
.uleb128 0x2
.byte 0x91
.sleb128 8
.uleb128 0xa
.long .LASF10
.byte 0x1
.byte 0xb
.long 0xb0
.uleb128 0x2
.byte 0x91
.sleb128 -12
.byte 0
.uleb128 0xb
.long .LASF18
.byte 0x1
.byte 0x12
.long 0x25
.long .LFB2
.long .LFE2-.LFB2
.uleb128 0x1
.byte 0x9c
.long 0x162
.uleb128 0x6
.long .LASF11
.byte 0x1
.byte 0x12
.long 0x25
.uleb128 0x2
.byte 0x91
.sleb128 0
.uleb128 0x6
.long .LASF12
.byte 0x1
.byte 0x12
.long 0x37
.uleb128 0x2
.byte 0x91
.sleb128 4
.uleb128 0x6
.long .LASF13
.byte 0x1
.byte 0x12
.long 0x162
.uleb128 0x2
.byte 0x91
.sleb128 8
.uleb128 0x7
.string "c"
.byte 0x1
.byte 0x1a
.long 0x168
.uleb128 0x2
.byte 0x91
.sleb128 -36
.uleb128 0x7
.string "ret"
.byte 0x1
.byte 0x28
.long 0x25
.uleb128 0x2
.byte 0x91
.sleb128 -20
.byte 0
.uleb128 0x8
.byte 0x4
.long 0x25
.uleb128 0xc
.long 0x5d
.long 0x178
.uleb128 0xd
.long 0x178
.byte 0xf
.byte 0
.uleb128 0x3
.byte 0x4
.byte 0x7
.long .LASF14
.uleb128 0xe
.long .LASF19
.byte 0x3
.byte 0x5
.long 0x25
.byte 0
.section .debug_abbrev,"",@progbits
.Ldebug_abbrev0:
.uleb128 0x1
.uleb128 0x11
.byte 0x1
.uleb128 0x25
.uleb128 0xe
.uleb128 0x13
.uleb128 0xb
.uleb128 0x3
.uleb128 0xe
.uleb128 0x1b
.uleb128 0xe
.uleb128 0x11
.uleb128 0x1
.uleb128 0x12
.uleb128 0x6
.uleb128 0x10
.uleb128 0x17
.byte 0
.byte 0
.uleb128 0x2
.uleb128 0x16
.byte 0
.uleb128 0x3
.uleb128 0x8
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.byte 0
.byte 0
.uleb128 0x3
.uleb128 0x24
.byte 0
.uleb128 0xb
.uleb128 0xb
.uleb128 0x3e
.uleb128 0xb
.uleb128 0x3
.uleb128 0xe
.byte 0
.byte 0
.uleb128 0x4
.uleb128 0x24
.byte 0
.uleb128 0xb
.uleb128 0xb
.uleb128 0x3e
.uleb128 0xb
.uleb128 0x3
.uleb128 0x8
.byte 0
.byte 0
.uleb128 0x5
.uleb128 0x2e
.byte 0x1
.uleb128 0x3f
.uleb128 0x19
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x27
.uleb128 0x19
.uleb128 0x11
.uleb128 0x1
.uleb128 0x12
.uleb128 0x6
.uleb128 0x40
.uleb128 0x18
.uleb128 0x2117
.uleb128 0x19
.uleb128 0x1
.uleb128 0x13
.byte 0
.byte 0
.uleb128 0x6
.uleb128 0x5
.byte 0
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.uleb128 0x2
.uleb128 0x18
.byte 0
.byte 0
.uleb128 0x7
.uleb128 0x34
.byte 0
.uleb128 0x3
.uleb128 0x8
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.uleb128 0x2
.uleb128 0x18
.byte 0
.byte 0
.uleb128 0x8
.uleb128 0xf
.byte 0
.uleb128 0xb
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.byte 0
.byte 0
.uleb128 0x9
.uleb128 0x5
.byte 0
.uleb128 0x3
.uleb128 0x8
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.uleb128 0x2
.uleb128 0x18
.byte 0
.byte 0
.uleb128 0xa
.uleb128 0x34
.byte 0
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.uleb128 0x2
.uleb128 0x18
.byte 0
.byte 0
.uleb128 0xb
.uleb128 0x2e
.byte 0x1
.uleb128 0x3f
.uleb128 0x19
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x27
.uleb128 0x19
.uleb128 0x49
.uleb128 0x13
.uleb128 0x11
.uleb128 0x1
.uleb128 0x12
.uleb128 0x6
.uleb128 0x40
.uleb128 0x18
.uleb128 0x2116
.uleb128 0x19
.uleb128 0x1
.uleb128 0x13
.byte 0
.byte 0
.uleb128 0xc
.uleb128 0x1
.byte 0x1
.uleb128 0x49
.uleb128 0x13
.uleb128 0x1
.uleb128 0x13
.byte 0
.byte 0
.uleb128 0xd
.uleb128 0x21
.byte 0
.uleb128 0x49
.uleb128 0x13
.uleb128 0x2f
.uleb128 0xb
.byte 0
.byte 0
.uleb128 0xe
.uleb128 0x34
.byte 0
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.uleb128 0x3f
.uleb128 0x19
.uleb128 0x3c
.uleb128 0x19
.byte 0
.byte 0
.byte 0
.section .debug_aranges,"",@progbits
.long 0x1c
.value 0x2
.long .Ldebug_info0
.byte 0x4
.byte 0
.value 0
.value 0
.long .Ltext0
.long .Letext0-.Ltext0
.long 0
.long 0
.section .debug_line,"",@progbits
.Ldebug_line0:
.section .debug_str,"MS",@progbits,1
.LASF7:
.string "nbytes"
.LASF16:
.string "./libc/mem.c"
.LASF0:
.string "unsigned int"
.LASF6:
.string "dest"
.LASF3:
.string "unsigned char"
.LASF10:
.string "temp"
.LASF17:
.string "/home/os/OS_Project/Part4/10_scheduler"
.LASF19:
.string "free_mem_addr"
.LASF4:
.string "char"
.LASF8:
.string "memory_copy"
.LASF12:
.string "align"
.LASF18:
.string "kmalloc"
.LASF13:
.string "phys_addr"
.LASF5:
.string "source"
.LASF15:
.string "GNU C11 5.4.0 20160609 -m32 -mtune=generic -march=i686 -g -fno-pie -ffreestanding -fno-builtin -fno-stack-protector"
.LASF1:
.string "short unsigned int"
.LASF11:
.string "size"
.LASF9:
.string "memory_set"
.LASF2:
.string "short int"
.LASF14:
.string "sizetype"
.ident "GCC: (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609"
.section .note.GNU-stack,"",@progbits

501
Part4/10_scheduler/ports.s Normal file
View File

@ -0,0 +1,501 @@
.file "ports.c"
.text
.Ltext0:
.globl port_byte_in
.type port_byte_in, @function
port_byte_in:
.LFB0:
.file 1 "./cpu/ports.c"
.loc 1 6 0
.cfi_startproc
pushl %ebp
.cfi_def_cfa_offset 8
.cfi_offset 5, -8
movl %esp, %ebp
.cfi_def_cfa_register 5
subl $20, %esp
movl 8(%ebp), %eax
movw %ax, -20(%ebp)
.loc 1 16 0
movzwl -20(%ebp), %eax
movl %eax, %edx
#APP
# 16 "./cpu/ports.c" 1
in %dx, %al
# 0 "" 2
#NO_APP
movb %al, -1(%ebp)
.loc 1 17 0
movzbl -1(%ebp), %eax
.loc 1 18 0
leave
.cfi_restore 5
.cfi_def_cfa 4, 4
ret
.cfi_endproc
.LFE0:
.size port_byte_in, .-port_byte_in
.globl port_byte_out
.type port_byte_out, @function
port_byte_out:
.LFB1:
.loc 1 20 0
.cfi_startproc
pushl %ebp
.cfi_def_cfa_offset 8
.cfi_offset 5, -8
movl %esp, %ebp
.cfi_def_cfa_register 5
subl $8, %esp
movl 8(%ebp), %edx
movl 12(%ebp), %eax
movw %dx, -4(%ebp)
movb %al, -8(%ebp)
.loc 1 26 0
movzbl -8(%ebp), %eax
movzwl -4(%ebp), %edx
#APP
# 26 "./cpu/ports.c" 1
out %al, %dx
# 0 "" 2
.loc 1 27 0
#NO_APP
nop
leave
.cfi_restore 5
.cfi_def_cfa 4, 4
ret
.cfi_endproc
.LFE1:
.size port_byte_out, .-port_byte_out
.globl port_word_in
.type port_word_in, @function
port_word_in:
.LFB2:
.loc 1 29 0
.cfi_startproc
pushl %ebp
.cfi_def_cfa_offset 8
.cfi_offset 5, -8
movl %esp, %ebp
.cfi_def_cfa_register 5
subl $20, %esp
movl 8(%ebp), %eax
movw %ax, -20(%ebp)
.loc 1 31 0
movzwl -20(%ebp), %eax
movl %eax, %edx
#APP
# 31 "./cpu/ports.c" 1
in %dx, %ax
# 0 "" 2
#NO_APP
movw %ax, -2(%ebp)
.loc 1 32 0
movzwl -2(%ebp), %eax
.loc 1 33 0
leave
.cfi_restore 5
.cfi_def_cfa 4, 4
ret
.cfi_endproc
.LFE2:
.size port_word_in, .-port_word_in
.globl port_word_out
.type port_word_out, @function
port_word_out:
.LFB3:
.loc 1 35 0
.cfi_startproc
pushl %ebp
.cfi_def_cfa_offset 8
.cfi_offset 5, -8
movl %esp, %ebp
.cfi_def_cfa_register 5
subl $8, %esp
movl 8(%ebp), %edx
movl 12(%ebp), %eax
movw %dx, -4(%ebp)
movw %ax, -8(%ebp)
.loc 1 36 0
movzwl -8(%ebp), %eax
movzwl -4(%ebp), %edx
#APP
# 36 "./cpu/ports.c" 1
out %ax, %dx
# 0 "" 2
.loc 1 37 0
#NO_APP
nop
leave
.cfi_restore 5
.cfi_def_cfa 4, 4
ret
.cfi_endproc
.LFE3:
.size port_word_out, .-port_word_out
.Letext0:
.file 2 "./cpu/../cpu/types.h"
.section .debug_info,"",@progbits
.Ldebug_info0:
.long 0x12d
.value 0x4
.long .Ldebug_abbrev0
.byte 0x4
.uleb128 0x1
.long .LASF10
.byte 0xc
.long .LASF11
.long .LASF12
.long .Ltext0
.long .Letext0-.Ltext0
.long .Ldebug_line0
.uleb128 0x2
.byte 0x4
.byte 0x7
.long .LASF0
.uleb128 0x3
.byte 0x4
.byte 0x5
.string "int"
.uleb128 0x4
.string "u16"
.byte 0x2
.byte 0x8
.long 0x3e
.uleb128 0x2
.byte 0x2
.byte 0x7
.long .LASF1
.uleb128 0x2
.byte 0x2
.byte 0x5
.long .LASF2
.uleb128 0x4
.string "u8"
.byte 0x2
.byte 0xa
.long 0x56
.uleb128 0x2
.byte 0x1
.byte 0x8
.long .LASF3
.uleb128 0x2
.byte 0x1
.byte 0x6
.long .LASF4
.uleb128 0x5
.long .LASF7
.byte 0x1
.byte 0x6
.long 0x4c
.long .LFB0
.long .LFE0-.LFB0
.uleb128 0x1
.byte 0x9c
.long 0x9a
.uleb128 0x6
.long .LASF5
.byte 0x1
.byte 0x6
.long 0x33
.uleb128 0x2
.byte 0x91
.sleb128 -28
.uleb128 0x7
.long .LASF9
.byte 0x1
.byte 0x7
.long 0x4c
.uleb128 0x2
.byte 0x91
.sleb128 -9
.byte 0
.uleb128 0x8
.long .LASF13
.byte 0x1
.byte 0x14
.long .LFB1
.long .LFE1-.LFB1
.uleb128 0x1
.byte 0x9c
.long 0xcc
.uleb128 0x6
.long .LASF5
.byte 0x1
.byte 0x14
.long 0x33
.uleb128 0x2
.byte 0x91
.sleb128 -12
.uleb128 0x6
.long .LASF6
.byte 0x1
.byte 0x14
.long 0x4c
.uleb128 0x2
.byte 0x91
.sleb128 -16
.byte 0
.uleb128 0x5
.long .LASF8
.byte 0x1
.byte 0x1d
.long 0x33
.long .LFB2
.long .LFE2-.LFB2
.uleb128 0x1
.byte 0x9c
.long 0x102
.uleb128 0x6
.long .LASF5
.byte 0x1
.byte 0x1d
.long 0x33
.uleb128 0x2
.byte 0x91
.sleb128 -28
.uleb128 0x7
.long .LASF9
.byte 0x1
.byte 0x1e
.long 0x33
.uleb128 0x2
.byte 0x91
.sleb128 -10
.byte 0
.uleb128 0x9
.long .LASF14
.byte 0x1
.byte 0x23
.long .LFB3
.long .LFE3-.LFB3
.uleb128 0x1
.byte 0x9c
.uleb128 0x6
.long .LASF5
.byte 0x1
.byte 0x23
.long 0x33
.uleb128 0x2
.byte 0x91
.sleb128 -12
.uleb128 0x6
.long .LASF6
.byte 0x1
.byte 0x23
.long 0x33
.uleb128 0x2
.byte 0x91
.sleb128 -16
.byte 0
.byte 0
.section .debug_abbrev,"",@progbits
.Ldebug_abbrev0:
.uleb128 0x1
.uleb128 0x11
.byte 0x1
.uleb128 0x25
.uleb128 0xe
.uleb128 0x13
.uleb128 0xb
.uleb128 0x3
.uleb128 0xe
.uleb128 0x1b
.uleb128 0xe
.uleb128 0x11
.uleb128 0x1
.uleb128 0x12
.uleb128 0x6
.uleb128 0x10
.uleb128 0x17
.byte 0
.byte 0
.uleb128 0x2
.uleb128 0x24
.byte 0
.uleb128 0xb
.uleb128 0xb
.uleb128 0x3e
.uleb128 0xb
.uleb128 0x3
.uleb128 0xe
.byte 0
.byte 0
.uleb128 0x3
.uleb128 0x24
.byte 0
.uleb128 0xb
.uleb128 0xb
.uleb128 0x3e
.uleb128 0xb
.uleb128 0x3
.uleb128 0x8
.byte 0
.byte 0
.uleb128 0x4
.uleb128 0x16
.byte 0
.uleb128 0x3
.uleb128 0x8
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.byte 0
.byte 0
.uleb128 0x5
.uleb128 0x2e
.byte 0x1
.uleb128 0x3f
.uleb128 0x19
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x27
.uleb128 0x19
.uleb128 0x49
.uleb128 0x13
.uleb128 0x11
.uleb128 0x1
.uleb128 0x12
.uleb128 0x6
.uleb128 0x40
.uleb128 0x18
.uleb128 0x2117
.uleb128 0x19
.uleb128 0x1
.uleb128 0x13
.byte 0
.byte 0
.uleb128 0x6
.uleb128 0x5
.byte 0
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.uleb128 0x2
.uleb128 0x18
.byte 0
.byte 0
.uleb128 0x7
.uleb128 0x34
.byte 0
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.uleb128 0x2
.uleb128 0x18
.byte 0
.byte 0
.uleb128 0x8
.uleb128 0x2e
.byte 0x1
.uleb128 0x3f
.uleb128 0x19
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x27
.uleb128 0x19
.uleb128 0x11
.uleb128 0x1
.uleb128 0x12
.uleb128 0x6
.uleb128 0x40
.uleb128 0x18
.uleb128 0x2117
.uleb128 0x19
.uleb128 0x1
.uleb128 0x13
.byte 0
.byte 0
.uleb128 0x9
.uleb128 0x2e
.byte 0x1
.uleb128 0x3f
.uleb128 0x19
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x27
.uleb128 0x19
.uleb128 0x11
.uleb128 0x1
.uleb128 0x12
.uleb128 0x6
.uleb128 0x40
.uleb128 0x18
.uleb128 0x2117
.uleb128 0x19
.byte 0
.byte 0
.byte 0
.section .debug_aranges,"",@progbits
.long 0x1c
.value 0x2
.long .Ldebug_info0
.byte 0x4
.byte 0
.value 0
.value 0
.long .Ltext0
.long .Letext0-.Ltext0
.long 0
.long 0
.section .debug_line,"",@progbits
.Ldebug_line0:
.section .debug_str,"MS",@progbits,1
.LASF0:
.string "unsigned int"
.LASF12:
.string "/home/os/OS_Project/Part4/10_scheduler"
.LASF3:
.string "unsigned char"
.LASF7:
.string "port_byte_in"
.LASF11:
.string "./cpu/ports.c"
.LASF10:
.string "GNU C11 5.4.0 20160609 -m32 -mtune=generic -march=i686 -g -fno-pie -ffreestanding -fno-builtin -fno-stack-protector"
.LASF2:
.string "short int"
.LASF9:
.string "result"
.LASF1:
.string "short unsigned int"
.LASF14:
.string "port_word_out"
.LASF8:
.string "port_word_in"
.LASF5:
.string "port"
.LASF6:
.string "data"
.LASF4:
.string "char"
.LASF13:
.string "port_byte_out"
.ident "GCC: (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609"
.section .note.GNU-stack,"",@progbits

0
Part4/10_scheduler/s_compile.sh Normal file → Executable file
View File

1345
Part4/10_scheduler/screen.s Normal file

File diff suppressed because it is too large Load Diff

998
Part4/10_scheduler/string.s Normal file
View File

@ -0,0 +1,998 @@
.file "string.c"
.text
.Ltext0:
.globl int_to_ascii
.type int_to_ascii, @function
int_to_ascii:
.LFB0:
.file 1 "./libc/string.c"
.loc 1 6 0
.cfi_startproc
pushl %ebp
.cfi_def_cfa_offset 8
.cfi_offset 5, -8
movl %esp, %ebp
.cfi_def_cfa_register 5
pushl %ebx
subl $20, %esp
.cfi_offset 3, -12
.loc 1 8 0
movl 8(%ebp), %eax
movl %eax, -16(%ebp)
cmpl $0, -16(%ebp)
jns .L2
.loc 1 8 0 is_stmt 0 discriminator 1
negl 8(%ebp)
.L2:
.loc 1 9 0 is_stmt 1
movl $0, -12(%ebp)
.L3:
.loc 1 11 0 discriminator 1
movl -12(%ebp), %eax
leal 1(%eax), %edx
movl %edx, -12(%ebp)
movl %eax, %edx
movl 12(%ebp), %eax
leal (%edx,%eax), %ebx
movl 8(%ebp), %ecx
movl $1717986919, %edx
movl %ecx, %eax
imull %edx
sarl $2, %edx
movl %ecx, %eax
sarl $31, %eax
subl %eax, %edx
movl %edx, %eax
sall $2, %eax
addl %edx, %eax
addl %eax, %eax
subl %eax, %ecx
movl %ecx, %edx
movl %edx, %eax
addl $48, %eax
movb %al, (%ebx)
.loc 1 12 0 discriminator 1
movl 8(%ebp), %ecx
movl $1717986919, %edx
movl %ecx, %eax
imull %edx
sarl $2, %edx
movl %ecx, %eax
sarl $31, %eax
subl %eax, %edx
movl %edx, %eax
movl %eax, 8(%ebp)
cmpl $0, 8(%ebp)
jg .L3
.loc 1 14 0
cmpl $0, -16(%ebp)
jns .L4
.loc 1 14 0 is_stmt 0 discriminator 1
movl -12(%ebp), %eax
leal 1(%eax), %edx
movl %edx, -12(%ebp)
movl %eax, %edx
movl 12(%ebp), %eax
addl %edx, %eax
movb $45, (%eax)
.L4:
.loc 1 15 0 is_stmt 1
movl -12(%ebp), %edx
movl 12(%ebp), %eax
addl %edx, %eax
movb $0, (%eax)
.loc 1 17 0
subl $12, %esp
pushl 12(%ebp)
call reverse
addl $16, %esp
.loc 1 18 0
nop
movl -4(%ebp), %ebx
leave
.cfi_restore 5
.cfi_restore 3
.cfi_def_cfa 4, 4
ret
.cfi_endproc
.LFE0:
.size int_to_ascii, .-int_to_ascii
.globl hex_to_ascii
.type hex_to_ascii, @function
hex_to_ascii:
.LFB1:
.loc 1 20 0
.cfi_startproc
pushl %ebp
.cfi_def_cfa_offset 8
.cfi_offset 5, -8
movl %esp, %ebp
.cfi_def_cfa_register 5
subl $24, %esp
.loc 1 21 0
movl 12(%ebp), %eax
movb $0, (%eax)
.loc 1 22 0
subl $8, %esp
pushl $48
pushl 12(%ebp)
call append
addl $16, %esp
.loc 1 23 0
subl $8, %esp
pushl $120
pushl 12(%ebp)
call append
addl $16, %esp
.loc 1 24 0
movb $0, -9(%ebp)
.loc 1 28 0
movl $28, -16(%ebp)
jmp .L6
.L10:
.loc 1 29 0
movl -16(%ebp), %eax
movl 8(%ebp), %edx
movl %eax, %ecx
sarl %cl, %edx
movl %edx, %eax
andl $15, %eax
movl %eax, -20(%ebp)
.loc 1 30 0
cmpl $0, -20(%ebp)
jne .L7
.loc 1 30 0 is_stmt 0 discriminator 1
cmpb $0, -9(%ebp)
je .L14
.L7:
.loc 1 31 0 is_stmt 1
movb $1, -9(%ebp)
.loc 1 32 0
cmpl $10, -20(%ebp)
jle .L9
.loc 1 32 0 is_stmt 0 discriminator 1
movl -20(%ebp), %eax
addl $87, %eax
movsbl %al, %eax
subl $8, %esp
pushl %eax
pushl 12(%ebp)
call append
addl $16, %esp
jmp .L8
.L9:
.loc 1 33 0 is_stmt 1
movl -20(%ebp), %eax
addl $48, %eax
movsbl %al, %eax
subl $8, %esp
pushl %eax
pushl 12(%ebp)
call append
addl $16, %esp
jmp .L8
.L14:
.loc 1 30 0
nop
.L8:
.loc 1 28 0 discriminator 2
subl $4, -16(%ebp)
.L6:
.loc 1 28 0 is_stmt 0 discriminator 1
cmpl $0, -16(%ebp)
jg .L10
.loc 1 36 0 is_stmt 1
movl 8(%ebp), %eax
andl $15, %eax
movl %eax, -20(%ebp)
.loc 1 37 0
cmpl $9, -20(%ebp)
jle .L11
.loc 1 37 0 is_stmt 0 discriminator 1
movl -20(%ebp), %eax
addl $87, %eax
movsbl %al, %eax
subl $8, %esp
pushl %eax
pushl 12(%ebp)
call append
addl $16, %esp
.loc 1 40 0 is_stmt 1 discriminator 1
jmp .L5
.L11:
.loc 1 38 0
movl -20(%ebp), %eax
addl $48, %eax
movsbl %al, %eax
subl $8, %esp
pushl %eax
pushl 12(%ebp)
call append
addl $16, %esp
.loc 1 40 0
nop
.L5:
.loc 1 41 0
leave
.cfi_restore 5
.cfi_def_cfa 4, 4
ret
.cfi_endproc
.LFE1:
.size hex_to_ascii, .-hex_to_ascii
.globl reverse
.type reverse, @function
reverse:
.LFB2:
.loc 1 44 0
.cfi_startproc
pushl %ebp
.cfi_def_cfa_offset 8
.cfi_offset 5, -8
movl %esp, %ebp
.cfi_def_cfa_register 5
subl $24, %esp
.loc 1 46 0
movl $0, -12(%ebp)
subl $12, %esp
pushl 8(%ebp)
call strlen
addl $16, %esp
subl $1, %eax
movl %eax, -16(%ebp)
jmp .L16
.L17:
.loc 1 47 0 discriminator 3
movl -12(%ebp), %edx
movl 8(%ebp), %eax
addl %edx, %eax
movzbl (%eax), %eax
movsbl %al, %eax
movl %eax, -20(%ebp)
.loc 1 48 0 discriminator 3
movl -12(%ebp), %edx
movl 8(%ebp), %eax
addl %eax, %edx
movl -16(%ebp), %ecx
movl 8(%ebp), %eax
addl %ecx, %eax
movzbl (%eax), %eax
movb %al, (%edx)
.loc 1 49 0 discriminator 3
movl -16(%ebp), %edx
movl 8(%ebp), %eax
addl %edx, %eax
movl -20(%ebp), %edx
movb %dl, (%eax)
.loc 1 46 0 discriminator 3
addl $1, -12(%ebp)
subl $1, -16(%ebp)
.L16:
.loc 1 46 0 is_stmt 0 discriminator 1
movl -12(%ebp), %eax
cmpl -16(%ebp), %eax
jl .L17
.loc 1 51 0 is_stmt 1
nop
leave
.cfi_restore 5
.cfi_def_cfa 4, 4
ret
.cfi_endproc
.LFE2:
.size reverse, .-reverse
.globl strlen
.type strlen, @function
strlen:
.LFB3:
.loc 1 54 0
.cfi_startproc
pushl %ebp
.cfi_def_cfa_offset 8
.cfi_offset 5, -8
movl %esp, %ebp
.cfi_def_cfa_register 5
subl $16, %esp
.loc 1 55 0
movl $0, -4(%ebp)
.loc 1 56 0
jmp .L19
.L20:
.loc 1 56 0 is_stmt 0 discriminator 2
addl $1, -4(%ebp)
.L19:
.loc 1 56 0 discriminator 1
movl -4(%ebp), %edx
movl 8(%ebp), %eax
addl %edx, %eax
movzbl (%eax), %eax
testb %al, %al
jne .L20
.loc 1 57 0 is_stmt 1
movl -4(%ebp), %eax
.loc 1 58 0
leave
.cfi_restore 5
.cfi_def_cfa 4, 4
ret
.cfi_endproc
.LFE3:
.size strlen, .-strlen
.globl append
.type append, @function
append:
.LFB4:
.loc 1 60 0
.cfi_startproc
pushl %ebp
.cfi_def_cfa_offset 8
.cfi_offset 5, -8
movl %esp, %ebp
.cfi_def_cfa_register 5
subl $20, %esp
movl 12(%ebp), %eax
movb %al, -20(%ebp)
.loc 1 61 0
pushl 8(%ebp)
call strlen
addl $4, %esp
movl %eax, -4(%ebp)
.loc 1 62 0
movl -4(%ebp), %edx
movl 8(%ebp), %eax
addl %eax, %edx
movzbl -20(%ebp), %eax
movb %al, (%edx)
.loc 1 63 0
movl -4(%ebp), %eax
leal 1(%eax), %edx
movl 8(%ebp), %eax
addl %edx, %eax
movb $0, (%eax)
.loc 1 64 0
nop
leave
.cfi_restore 5
.cfi_def_cfa 4, 4
ret
.cfi_endproc
.LFE4:
.size append, .-append
.globl backspace
.type backspace, @function
backspace:
.LFB5:
.loc 1 66 0
.cfi_startproc
pushl %ebp
.cfi_def_cfa_offset 8
.cfi_offset 5, -8
movl %esp, %ebp
.cfi_def_cfa_register 5
subl $16, %esp
.loc 1 67 0
pushl 8(%ebp)
call strlen
addl $4, %esp
movl %eax, -4(%ebp)
.loc 1 68 0
movl -4(%ebp), %eax
leal -1(%eax), %edx
movl 8(%ebp), %eax
addl %edx, %eax
movb $0, (%eax)
.loc 1 69 0
nop
leave
.cfi_restore 5
.cfi_def_cfa 4, 4
ret
.cfi_endproc
.LFE5:
.size backspace, .-backspace
.globl strcmp
.type strcmp, @function
strcmp:
.LFB6:
.loc 1 73 0
.cfi_startproc
pushl %ebp
.cfi_def_cfa_offset 8
.cfi_offset 5, -8
movl %esp, %ebp
.cfi_def_cfa_register 5
subl $16, %esp
.loc 1 75 0
movl $0, -4(%ebp)
jmp .L25
.L28:
.loc 1 76 0
movl -4(%ebp), %edx
movl 8(%ebp), %eax
addl %edx, %eax
movzbl (%eax), %eax
testb %al, %al
jne .L26
.loc 1 76 0 is_stmt 0 discriminator 1
movl $0, %eax
jmp .L27
.L26:
.loc 1 75 0 is_stmt 1 discriminator 2
addl $1, -4(%ebp)
.L25:
.loc 1 75 0 is_stmt 0 discriminator 1
movl -4(%ebp), %edx
movl 8(%ebp), %eax
addl %edx, %eax
movzbl (%eax), %edx
movl -4(%ebp), %ecx
movl 12(%ebp), %eax
addl %ecx, %eax
movzbl (%eax), %eax
cmpb %al, %dl
je .L28
.loc 1 78 0 is_stmt 1
movl -4(%ebp), %edx
movl 8(%ebp), %eax
addl %edx, %eax
movzbl (%eax), %eax
movsbl %al, %edx
movl -4(%ebp), %ecx
movl 12(%ebp), %eax
addl %ecx, %eax
movzbl (%eax), %eax
movsbl %al, %eax
subl %eax, %edx
movl %edx, %eax
.L27:
.loc 1 79 0
leave
.cfi_restore 5
.cfi_def_cfa 4, 4
ret
.cfi_endproc
.LFE6:
.size strcmp, .-strcmp
.Letext0:
.file 2 "./libc/../cpu/types.h"
.section .debug_info,"",@progbits
.Ldebug_info0:
.long 0x21f
.value 0x4
.long .Ldebug_abbrev0
.byte 0x4
.uleb128 0x1
.long .LASF13
.byte 0xc
.long .LASF14
.long .LASF15
.long .Ltext0
.long .Letext0-.Ltext0
.long .Ldebug_line0
.uleb128 0x2
.byte 0x4
.byte 0x7
.long .LASF0
.uleb128 0x3
.string "s32"
.byte 0x2
.byte 0x7
.long 0x37
.uleb128 0x4
.byte 0x4
.byte 0x5
.string "int"
.uleb128 0x2
.byte 0x2
.byte 0x7
.long .LASF1
.uleb128 0x2
.byte 0x2
.byte 0x5
.long .LASF2
.uleb128 0x2
.byte 0x1
.byte 0x8
.long .LASF3
.uleb128 0x2
.byte 0x1
.byte 0x6
.long .LASF4
.uleb128 0x5
.long .LASF6
.byte 0x1
.byte 0x6
.long .LFB0
.long .LFE0-.LFB0
.uleb128 0x1
.byte 0x9c
.long 0xa4
.uleb128 0x6
.string "n"
.byte 0x1
.byte 0x6
.long 0x37
.uleb128 0x2
.byte 0x91
.sleb128 0
.uleb128 0x6
.string "str"
.byte 0x1
.byte 0x6
.long 0xa4
.uleb128 0x2
.byte 0x91
.sleb128 4
.uleb128 0x7
.string "i"
.byte 0x1
.byte 0x7
.long 0x37
.uleb128 0x2
.byte 0x91
.sleb128 -20
.uleb128 0x8
.long .LASF5
.byte 0x1
.byte 0x7
.long 0x37
.uleb128 0x2
.byte 0x91
.sleb128 -24
.byte 0
.uleb128 0x9
.byte 0x4
.long 0x53
.uleb128 0x5
.long .LASF7
.byte 0x1
.byte 0x14
.long .LFB1
.long .LFE1-.LFB1
.uleb128 0x1
.byte 0x9c
.long 0x102
.uleb128 0x6
.string "n"
.byte 0x1
.byte 0x14
.long 0x37
.uleb128 0x2
.byte 0x91
.sleb128 0
.uleb128 0x6
.string "str"
.byte 0x1
.byte 0x14
.long 0xa4
.uleb128 0x2
.byte 0x91
.sleb128 4
.uleb128 0x8
.long .LASF8
.byte 0x1
.byte 0x18
.long 0x53
.uleb128 0x2
.byte 0x91
.sleb128 -17
.uleb128 0x7
.string "tmp"
.byte 0x1
.byte 0x1a
.long 0x2c
.uleb128 0x2
.byte 0x91
.sleb128 -28
.uleb128 0x7
.string "i"
.byte 0x1
.byte 0x1b
.long 0x37
.uleb128 0x2
.byte 0x91
.sleb128 -24
.byte 0
.uleb128 0x5
.long .LASF9
.byte 0x1
.byte 0x2c
.long .LFB2
.long .LFE2-.LFB2
.uleb128 0x1
.byte 0x9c
.long 0x148
.uleb128 0x6
.string "s"
.byte 0x1
.byte 0x2c
.long 0xa4
.uleb128 0x2
.byte 0x91
.sleb128 0
.uleb128 0x7
.string "c"
.byte 0x1
.byte 0x2d
.long 0x37
.uleb128 0x2
.byte 0x91
.sleb128 -28
.uleb128 0x7
.string "i"
.byte 0x1
.byte 0x2d
.long 0x37
.uleb128 0x2
.byte 0x91
.sleb128 -20
.uleb128 0x7
.string "j"
.byte 0x1
.byte 0x2d
.long 0x37
.uleb128 0x2
.byte 0x91
.sleb128 -24
.byte 0
.uleb128 0xa
.long .LASF16
.byte 0x1
.byte 0x36
.long 0x37
.long .LFB3
.long .LFE3-.LFB3
.uleb128 0x1
.byte 0x9c
.long 0x17a
.uleb128 0x6
.string "s"
.byte 0x1
.byte 0x36
.long 0xa4
.uleb128 0x2
.byte 0x91
.sleb128 0
.uleb128 0x7
.string "i"
.byte 0x1
.byte 0x37
.long 0x37
.uleb128 0x2
.byte 0x91
.sleb128 -12
.byte 0
.uleb128 0x5
.long .LASF10
.byte 0x1
.byte 0x3c
.long .LFB4
.long .LFE4-.LFB4
.uleb128 0x1
.byte 0x9c
.long 0x1b6
.uleb128 0x6
.string "s"
.byte 0x1
.byte 0x3c
.long 0xa4
.uleb128 0x2
.byte 0x91
.sleb128 0
.uleb128 0x6
.string "n"
.byte 0x1
.byte 0x3c
.long 0x53
.uleb128 0x2
.byte 0x91
.sleb128 -28
.uleb128 0x7
.string "len"
.byte 0x1
.byte 0x3d
.long 0x37
.uleb128 0x2
.byte 0x91
.sleb128 -12
.byte 0
.uleb128 0x5
.long .LASF11
.byte 0x1
.byte 0x42
.long .LFB5
.long .LFE5-.LFB5
.uleb128 0x1
.byte 0x9c
.long 0x1e6
.uleb128 0x6
.string "s"
.byte 0x1
.byte 0x42
.long 0xa4
.uleb128 0x2
.byte 0x91
.sleb128 0
.uleb128 0x7
.string "len"
.byte 0x1
.byte 0x43
.long 0x37
.uleb128 0x2
.byte 0x91
.sleb128 -12
.byte 0
.uleb128 0xb
.long .LASF12
.byte 0x1
.byte 0x49
.long 0x37
.long .LFB6
.long .LFE6-.LFB6
.uleb128 0x1
.byte 0x9c
.uleb128 0x6
.string "s1"
.byte 0x1
.byte 0x49
.long 0xa4
.uleb128 0x2
.byte 0x91
.sleb128 0
.uleb128 0x6
.string "s2"
.byte 0x1
.byte 0x49
.long 0xa4
.uleb128 0x2
.byte 0x91
.sleb128 4
.uleb128 0x7
.string "i"
.byte 0x1
.byte 0x4a
.long 0x37
.uleb128 0x2
.byte 0x91
.sleb128 -12
.byte 0
.byte 0
.section .debug_abbrev,"",@progbits
.Ldebug_abbrev0:
.uleb128 0x1
.uleb128 0x11
.byte 0x1
.uleb128 0x25
.uleb128 0xe
.uleb128 0x13
.uleb128 0xb
.uleb128 0x3
.uleb128 0xe
.uleb128 0x1b
.uleb128 0xe
.uleb128 0x11
.uleb128 0x1
.uleb128 0x12
.uleb128 0x6
.uleb128 0x10
.uleb128 0x17
.byte 0
.byte 0
.uleb128 0x2
.uleb128 0x24
.byte 0
.uleb128 0xb
.uleb128 0xb
.uleb128 0x3e
.uleb128 0xb
.uleb128 0x3
.uleb128 0xe
.byte 0
.byte 0
.uleb128 0x3
.uleb128 0x16
.byte 0
.uleb128 0x3
.uleb128 0x8
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.byte 0
.byte 0
.uleb128 0x4
.uleb128 0x24
.byte 0
.uleb128 0xb
.uleb128 0xb
.uleb128 0x3e
.uleb128 0xb
.uleb128 0x3
.uleb128 0x8
.byte 0
.byte 0
.uleb128 0x5
.uleb128 0x2e
.byte 0x1
.uleb128 0x3f
.uleb128 0x19
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x27
.uleb128 0x19
.uleb128 0x11
.uleb128 0x1
.uleb128 0x12
.uleb128 0x6
.uleb128 0x40
.uleb128 0x18
.uleb128 0x2116
.uleb128 0x19
.uleb128 0x1
.uleb128 0x13
.byte 0
.byte 0
.uleb128 0x6
.uleb128 0x5
.byte 0
.uleb128 0x3
.uleb128 0x8
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.uleb128 0x2
.uleb128 0x18
.byte 0
.byte 0
.uleb128 0x7
.uleb128 0x34
.byte 0
.uleb128 0x3
.uleb128 0x8
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.uleb128 0x2
.uleb128 0x18
.byte 0
.byte 0
.uleb128 0x8
.uleb128 0x34
.byte 0
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.uleb128 0x2
.uleb128 0x18
.byte 0
.byte 0
.uleb128 0x9
.uleb128 0xf
.byte 0
.uleb128 0xb
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.byte 0
.byte 0
.uleb128 0xa
.uleb128 0x2e
.byte 0x1
.uleb128 0x3f
.uleb128 0x19
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x27
.uleb128 0x19
.uleb128 0x49
.uleb128 0x13
.uleb128 0x11
.uleb128 0x1
.uleb128 0x12
.uleb128 0x6
.uleb128 0x40
.uleb128 0x18
.uleb128 0x2117
.uleb128 0x19
.uleb128 0x1
.uleb128 0x13
.byte 0
.byte 0
.uleb128 0xb
.uleb128 0x2e
.byte 0x1
.uleb128 0x3f
.uleb128 0x19
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x27
.uleb128 0x19
.uleb128 0x49
.uleb128 0x13
.uleb128 0x11
.uleb128 0x1
.uleb128 0x12
.uleb128 0x6
.uleb128 0x40
.uleb128 0x18
.uleb128 0x2117
.uleb128 0x19
.byte 0
.byte 0
.byte 0
.section .debug_aranges,"",@progbits
.long 0x1c
.value 0x2
.long .Ldebug_info0
.byte 0x4
.byte 0
.value 0
.value 0
.long .Ltext0
.long .Letext0-.Ltext0
.long 0
.long 0
.section .debug_line,"",@progbits
.Ldebug_line0:
.section .debug_str,"MS",@progbits,1
.LASF0:
.string "unsigned int"
.LASF8:
.string "zeros"
.LASF7:
.string "hex_to_ascii"
.LASF15:
.string "/home/os/OS_Project/Part4/10_scheduler"
.LASF5:
.string "sign"
.LASF6:
.string "int_to_ascii"
.LASF3:
.string "unsigned char"
.LASF4:
.string "char"
.LASF12:
.string "strcmp"
.LASF14:
.string "./libc/string.c"
.LASF9:
.string "reverse"
.LASF10:
.string "append"
.LASF13:
.string "GNU C11 5.4.0 20160609 -m32 -mtune=generic -march=i686 -g -fno-pie -ffreestanding -fno-builtin -fno-stack-protector"
.LASF16:
.string "strlen"
.LASF1:
.string "short unsigned int"
.LASF2:
.string "short int"
.LASF11:
.string "backspace"
.ident "GCC: (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609"
.section .note.GNU-stack,"",@progbits

601
Part4/10_scheduler/timer.s Normal file
View File

@ -0,0 +1,601 @@
.file "timer.c"
.text
.Ltext0:
.globl tick
.bss
.align 4
.type tick, @object
.size tick, 4
tick:
.zero 4
.text
.type timer_callback, @function
timer_callback:
.LFB0:
.file 1 "./cpu/timer.c"
.loc 1 8 0
.cfi_startproc
pushl %ebp
.cfi_def_cfa_offset 8
.cfi_offset 5, -8
movl %esp, %ebp
.cfi_def_cfa_register 5
.loc 1 9 0
movl tick, %eax
addl $1, %eax
movl %eax, tick
.loc 1 11 0
nop
popl %ebp
.cfi_restore 5
.cfi_def_cfa 4, 4
ret
.cfi_endproc
.LFE0:
.size timer_callback, .-timer_callback
.globl init_timer
.type init_timer, @function
init_timer:
.LFB1:
.loc 1 13 0
.cfi_startproc
pushl %ebp
.cfi_def_cfa_offset 8
.cfi_offset 5, -8
movl %esp, %ebp
.cfi_def_cfa_register 5
subl $24, %esp
.loc 1 15 0
subl $8, %esp
pushl $timer_callback
pushl $32
call register_interrupt_handler
addl $16, %esp
.loc 1 18 0
movl $1193180, %eax
movl $0, %edx
divl 8(%ebp)
movl %eax, -12(%ebp)
.loc 1 19 0
movl -12(%ebp), %eax
movb %al, -13(%ebp)
.loc 1 20 0
movl -12(%ebp), %eax
shrl $8, %eax
movb %al, -14(%ebp)
.loc 1 22 0
subl $8, %esp
pushl $54
pushl $67
call port_byte_out
addl $16, %esp
.loc 1 23 0
movzbl -13(%ebp), %eax
subl $8, %esp
pushl %eax
pushl $64
call port_byte_out
addl $16, %esp
.loc 1 24 0
movzbl -14(%ebp), %eax
subl $8, %esp
pushl %eax
pushl $64
call port_byte_out
addl $16, %esp
.loc 1 25 0
nop
leave
.cfi_restore 5
.cfi_def_cfa 4, 4
ret
.cfi_endproc
.LFE1:
.size init_timer, .-init_timer
.Letext0:
.file 2 "./cpu/types.h"
.file 3 "./cpu/isr.h"
.section .debug_info,"",@progbits
.Ldebug_info0:
.long 0x1b5
.value 0x4
.long .Ldebug_abbrev0
.byte 0x4
.uleb128 0x1
.long .LASF14
.byte 0xc
.long .LASF15
.long .LASF16
.long .Ltext0
.long .Letext0-.Ltext0
.long .Ldebug_line0
.uleb128 0x2
.string "u32"
.byte 0x2
.byte 0x6
.long 0x30
.uleb128 0x3
.byte 0x4
.byte 0x7
.long .LASF0
.uleb128 0x4
.byte 0x4
.byte 0x5
.string "int"
.uleb128 0x3
.byte 0x2
.byte 0x7
.long .LASF1
.uleb128 0x3
.byte 0x2
.byte 0x5
.long .LASF2
.uleb128 0x2
.string "u8"
.byte 0x2
.byte 0xa
.long 0x56
.uleb128 0x3
.byte 0x1
.byte 0x8
.long .LASF3
.uleb128 0x3
.byte 0x1
.byte 0x6
.long .LASF4
.uleb128 0x5
.byte 0x40
.byte 0x3
.byte 0x4b
.long 0x12a
.uleb128 0x6
.string "ds"
.byte 0x3
.byte 0x4c
.long 0x25
.byte 0
.uleb128 0x6
.string "edi"
.byte 0x3
.byte 0x4d
.long 0x25
.byte 0x4
.uleb128 0x6
.string "esi"
.byte 0x3
.byte 0x4d
.long 0x25
.byte 0x8
.uleb128 0x6
.string "ebp"
.byte 0x3
.byte 0x4d
.long 0x25
.byte 0xc
.uleb128 0x6
.string "esp"
.byte 0x3
.byte 0x4d
.long 0x25
.byte 0x10
.uleb128 0x6
.string "ebx"
.byte 0x3
.byte 0x4d
.long 0x25
.byte 0x14
.uleb128 0x6
.string "edx"
.byte 0x3
.byte 0x4d
.long 0x25
.byte 0x18
.uleb128 0x6
.string "ecx"
.byte 0x3
.byte 0x4d
.long 0x25
.byte 0x1c
.uleb128 0x6
.string "eax"
.byte 0x3
.byte 0x4d
.long 0x25
.byte 0x20
.uleb128 0x7
.long .LASF5
.byte 0x3
.byte 0x4e
.long 0x25
.byte 0x24
.uleb128 0x7
.long .LASF6
.byte 0x3
.byte 0x4e
.long 0x25
.byte 0x28
.uleb128 0x6
.string "eip"
.byte 0x3
.byte 0x4f
.long 0x25
.byte 0x2c
.uleb128 0x6
.string "cs"
.byte 0x3
.byte 0x4f
.long 0x25
.byte 0x30
.uleb128 0x7
.long .LASF7
.byte 0x3
.byte 0x4f
.long 0x25
.byte 0x34
.uleb128 0x7
.long .LASF8
.byte 0x3
.byte 0x4f
.long 0x25
.byte 0x38
.uleb128 0x6
.string "ss"
.byte 0x3
.byte 0x4f
.long 0x25
.byte 0x3c
.byte 0
.uleb128 0x8
.long .LASF9
.byte 0x3
.byte 0x50
.long 0x64
.uleb128 0x9
.long .LASF17
.byte 0x1
.byte 0x8
.long .LFB0
.long .LFE0-.LFB0
.uleb128 0x1
.byte 0x9c
.long 0x159
.uleb128 0xa
.long .LASF10
.byte 0x1
.byte 0x8
.long 0x12a
.uleb128 0x2
.byte 0x91
.sleb128 0
.byte 0
.uleb128 0xb
.long .LASF18
.byte 0x1
.byte 0xd
.long .LFB1
.long .LFE1-.LFB1
.uleb128 0x1
.byte 0x9c
.long 0x1a7
.uleb128 0xa
.long .LASF11
.byte 0x1
.byte 0xd
.long 0x25
.uleb128 0x2
.byte 0x91
.sleb128 0
.uleb128 0xc
.long .LASF12
.byte 0x1
.byte 0x12
.long 0x25
.uleb128 0x2
.byte 0x91
.sleb128 -20
.uleb128 0xd
.string "low"
.byte 0x1
.byte 0x13
.long 0x4c
.uleb128 0x2
.byte 0x91
.sleb128 -21
.uleb128 0xc
.long .LASF13
.byte 0x1
.byte 0x14
.long 0x4c
.uleb128 0x2
.byte 0x91
.sleb128 -22
.byte 0
.uleb128 0xe
.long .LASF19
.byte 0x1
.byte 0x6
.long 0x25
.uleb128 0x5
.byte 0x3
.long tick
.byte 0
.section .debug_abbrev,"",@progbits
.Ldebug_abbrev0:
.uleb128 0x1
.uleb128 0x11
.byte 0x1
.uleb128 0x25
.uleb128 0xe
.uleb128 0x13
.uleb128 0xb
.uleb128 0x3
.uleb128 0xe
.uleb128 0x1b
.uleb128 0xe
.uleb128 0x11
.uleb128 0x1
.uleb128 0x12
.uleb128 0x6
.uleb128 0x10
.uleb128 0x17
.byte 0
.byte 0
.uleb128 0x2
.uleb128 0x16
.byte 0
.uleb128 0x3
.uleb128 0x8
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.byte 0
.byte 0
.uleb128 0x3
.uleb128 0x24
.byte 0
.uleb128 0xb
.uleb128 0xb
.uleb128 0x3e
.uleb128 0xb
.uleb128 0x3
.uleb128 0xe
.byte 0
.byte 0
.uleb128 0x4
.uleb128 0x24
.byte 0
.uleb128 0xb
.uleb128 0xb
.uleb128 0x3e
.uleb128 0xb
.uleb128 0x3
.uleb128 0x8
.byte 0
.byte 0
.uleb128 0x5
.uleb128 0x13
.byte 0x1
.uleb128 0xb
.uleb128 0xb
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x1
.uleb128 0x13
.byte 0
.byte 0
.uleb128 0x6
.uleb128 0xd
.byte 0
.uleb128 0x3
.uleb128 0x8
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.uleb128 0x38
.uleb128 0xb
.byte 0
.byte 0
.uleb128 0x7
.uleb128 0xd
.byte 0
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.uleb128 0x38
.uleb128 0xb
.byte 0
.byte 0
.uleb128 0x8
.uleb128 0x16
.byte 0
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.byte 0
.byte 0
.uleb128 0x9
.uleb128 0x2e
.byte 0x1
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x27
.uleb128 0x19
.uleb128 0x11
.uleb128 0x1
.uleb128 0x12
.uleb128 0x6
.uleb128 0x40
.uleb128 0x18
.uleb128 0x2117
.uleb128 0x19
.uleb128 0x1
.uleb128 0x13
.byte 0
.byte 0
.uleb128 0xa
.uleb128 0x5
.byte 0
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.uleb128 0x2
.uleb128 0x18
.byte 0
.byte 0
.uleb128 0xb
.uleb128 0x2e
.byte 0x1
.uleb128 0x3f
.uleb128 0x19
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x27
.uleb128 0x19
.uleb128 0x11
.uleb128 0x1
.uleb128 0x12
.uleb128 0x6
.uleb128 0x40
.uleb128 0x18
.uleb128 0x2116
.uleb128 0x19
.uleb128 0x1
.uleb128 0x13
.byte 0
.byte 0
.uleb128 0xc
.uleb128 0x34
.byte 0
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.uleb128 0x2
.uleb128 0x18
.byte 0
.byte 0
.uleb128 0xd
.uleb128 0x34
.byte 0
.uleb128 0x3
.uleb128 0x8
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.uleb128 0x2
.uleb128 0x18
.byte 0
.byte 0
.uleb128 0xe
.uleb128 0x34
.byte 0
.uleb128 0x3
.uleb128 0xe
.uleb128 0x3a
.uleb128 0xb
.uleb128 0x3b
.uleb128 0xb
.uleb128 0x49
.uleb128 0x13
.uleb128 0x3f
.uleb128 0x19
.uleb128 0x2
.uleb128 0x18
.byte 0
.byte 0
.byte 0
.section .debug_aranges,"",@progbits
.long 0x1c
.value 0x2
.long .Ldebug_info0
.byte 0x4
.byte 0
.value 0
.value 0
.long .Ltext0
.long .Letext0-.Ltext0
.long 0
.long 0
.section .debug_line,"",@progbits
.Ldebug_line0:
.section .debug_str,"MS",@progbits,1
.LASF0:
.string "unsigned int"
.LASF3:
.string "unsigned char"
.LASF18:
.string "init_timer"
.LASF13:
.string "high"
.LASF15:
.string "./cpu/timer.c"
.LASF16:
.string "/home/os/OS_Project/Part4/10_scheduler"
.LASF7:
.string "eflags"
.LASF19:
.string "tick"
.LASF4:
.string "char"
.LASF10:
.string "regs"
.LASF8:
.string "useresp"
.LASF17:
.string "timer_callback"
.LASF14:
.string "GNU C11 5.4.0 20160609 -m32 -mtune=generic -march=i686 -g -fno-pie -ffreestanding -fno-builtin -fno-stack-protector"
.LASF1:
.string "short unsigned int"
.LASF6:
.string "err_code"
.LASF9:
.string "registers_t"
.LASF12:
.string "divisor"
.LASF2:
.string "short int"
.LASF5:
.string "int_no"
.LASF11:
.string "freq"
.ident "GCC: (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609"
.section .note.GNU-stack,"",@progbits