Skip to content

Commit

Permalink
删除废弃的函数
Browse files Browse the repository at this point in the history
  • Loading branch information
copi143 committed Nov 9, 2024
1 parent b0e8c5e commit e602c60
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 244 deletions.
2 changes: 0 additions & 2 deletions include/kernel/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,7 @@ typedef struct regs16 {
u16 gs, fs, es, ds, eflags;
} regs16;

void asm16_int(byte intnum, regs16 *regs);
void v86_int(byte intnum, regs16 *regs);
void do_init_seg_register();
void init_page();
void init_gdtidt();
void fpu_disable();
Expand Down
19 changes: 0 additions & 19 deletions src/kernel/cpu/bios_call.c

This file was deleted.

210 changes: 0 additions & 210 deletions src/kernel/cpu/int32.asm

This file was deleted.

10 changes: 2 additions & 8 deletions src/kernel/cpu/x86.asm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
GLOBAL asm_get_flags, asm_set_flags
GLOBAL move_cursor_by_idx
GLOBAL memtest_sub, farjmp, farcall, start_app
GLOBAL return_to_app, do_init_seg_register, entering_v86
GLOBAL return_to_app, entering_v86
section .text
%define ADR_BOTPAK 0x0
Expand Down Expand Up @@ -210,13 +210,7 @@ task_start:
; pop ds
; ret
; retuen_to_app_end:
do_init_seg_register:
pusha
mov ax, 1 * 8
mov gs, ax
mov fs, ax
popa
ret

; extern void entering_v86(u32 ss, u32 esp, u32 cs, u32 eip);
entering_v86:
mov ebp, esp ; save stack pointer
Expand Down
2 changes: 1 addition & 1 deletion src/kernel/drivers/general/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void pci_write_command_status(u8 bus, u8 slot, u8 func, u32 value) {
write_pci(bus, slot, func, 0x04, value);
}

base_address_register get_base_address_register(u8 bus, u8 device, u8 function, u8 bar) {
static base_address_register get_base_address_register(u8 bus, u8 device, u8 function, u8 bar) {
base_address_register result;

u32 headertype = read_pci(bus, device, function, 0x0e) & 0x7e;
Expand Down
3 changes: 1 addition & 2 deletions src/kernel/drivers/general/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ void init_pit() {
asm_out8(0x43, 0x34);
asm_out8(0x40, 0x9c);
asm_out8(0x40, 0x2e);
int i;
struct TIMER *t;
timerctl.count = 0;
for (i = 0; i < MAX_TIMER; i++) {
for (int i = 0; i < MAX_TIMER; i++) {
timerctl.timers0[i].flags = 0; /* 没有使用 */
}
t = timer_alloc(); /* 取得一个 */
Expand Down
2 changes: 1 addition & 1 deletion src/kernel/drivers/storage/fdc.c
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,6 @@ void bios_fdc_rw(int block, byte *blockbuff, int read, u64 nosectors) {
r.dx = N(head, 0);
r.es = 0x7e0;
r.bx = 0;
asm16_int(0x13, &r);
v86_int(0x13, &r);
if (read) { memcpy(blockbuff, p_tbaddr, 512); }
}
1 change: 0 additions & 1 deletion src/kernel/init/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ void *pci_addr_base;
#pragma clang optimize off

void sysinit() {
// do_init_seg_register();
total_mem_size = memtest(0x00400000, 0xbfffffff);
init_page();

Expand Down

0 comments on commit e602c60

Please sign in to comment.