Skip to content
This repository has been archived by the owner on Nov 4, 2020. It is now read-only.

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
Valentin authored and Valentin committed Jul 3, 2018
1 parent abe5cce commit 541f85b
Show file tree
Hide file tree
Showing 52 changed files with 38 additions and 23 deletions.
9 changes: 5 additions & 4 deletions filesystem/devfs.c 100644 → 100755
Expand Up @@ -82,14 +82,15 @@ error_t devfs_list_dir(list_entry_t* dest, fsnode_t* dir, u32* size)

list_entry_t* ptr = dest;

while(((uintptr_t)dirptr) < ((uintptr_t)(spe->device_struct+dir->length)))
while(((uintptr_t)dirptr) < (((uintptr_t)(spe->device_struct))+dir->length))
{
devfs_dirent_t* dirent = (devfs_dirent_t*) dirptr;
if(!dirent->node) break;

u32 name_len = strlen(dirent->name);
dirent_t* fd = kmalloc(sizeof(dirent)+name_len);
strcpy(fd->name, dirent->name);
dirent_t* fd = kmalloc(sizeof(dirent_t)+name_len+1);

strncpy(fd->name, dirent->name, name_len);
fd->name_len = name_len;
fd->inode = (uintptr_t) dirent->node;

Expand Down
Empty file modified filesystem/ext2.h 100644 → 100755
Empty file.
Empty file modified filesystem/fat32.c 100644 → 100755
Empty file.
Empty file modified filesystem/fat32.h 100644 → 100755
Empty file.
Empty file modified filesystem/fs.h 100644 → 100755
Empty file.
Empty file modified filesystem/iso9660.h 100644 → 100755
Empty file.
Empty file modified filesystem/vfs.c 100644 → 100755
Empty file.
Empty file modified internal/internal.h 100644 → 100755
Empty file.
Empty file modified internal/pci.c 100644 → 100755
Empty file.
Empty file modified internal/pci.h 100644 → 100755
Empty file.
Empty file modified internal/pic.c 100644 → 100755
Empty file.
Empty file modified io/io.h 100644 → 100755
Empty file.
Empty file modified io/ioctl.h 100644 → 100755
Empty file.
Empty file modified io/stream.c 100644 → 100755
Empty file.
Empty file modified io/termios.h 100644 → 100755
Empty file.
Empty file modified io/ttys.c 100644 → 100755
Empty file.
Empty file modified memory/kheap.c 100644 → 100755
Empty file.
Empty file modified memory/kpageheap.c 100644 → 100755
Empty file.
Empty file modified memory/kvmheap.c 100644 → 100755
Empty file.
Empty file modified memory/mem.h 100644 → 100755
Empty file.
Empty file modified memory/paging.c 100644 → 100755
Empty file.
Empty file modified memory/physical.c 100644 → 100755
Empty file.
Empty file modified storage/ata/ata_common.c 100644 → 100755
Empty file.
Empty file modified storage/ata/ata_dma.c 100644 → 100755
Empty file.
Empty file modified storage/ata/ata_pio.c 100644 → 100755
Empty file.
Empty file modified storage/ata/atapi.c 100644 → 100755
Empty file.
Empty file modified storage/block_devices.c 100644 → 100755
Empty file.
Empty file modified storage/storage.h 100644 → 100755
Empty file.
Empty file modified sync/mutex.c 100644 → 100755
Empty file.
Empty file modified sync/mutex.s 100644 → 100755
Empty file.
Empty file modified sync/sync.h 100644 → 100755
Empty file.
Empty file modified tasking/processes/elf.c 100644 → 100755
Empty file.
Empty file modified tasking/processes/external_structures.h 100644 → 100755
Empty file.
Empty file modified tasking/processes/groups.c 100644 → 100755
Empty file.
Empty file modified tasking/processes/process.c 100644 → 100755
Empty file.
Empty file modified tasking/processes/signal.c 100644 → 100755
Empty file.
Empty file modified tasking/processes/signal.h 100644 → 100755
Empty file.
8 changes: 4 additions & 4 deletions tasking/processes/syscalls.c 100644 → 100755
Expand Up @@ -54,9 +54,9 @@ void syscall_open(u32 ebx, u32 ecx, u32 edx)
}

fd_t* file = open_file(path, (u8) ecx);
//kprintf("%lSYS_OPEN : %s = 0x%X\n", 3, path, file);
kprintf("%lSYS_OPEN : %s = 0x%X\n", 3, path, file);
if(!file) {asm("mov $0, %%eax ; mov %0, %%ecx"::"N"(ERROR_FILE_NOT_FOUND):"%eax", "%ecx"); return;}

if(current_process->files_count == current_process->files_size)
{
current_process->files_size*=2;
Expand Down Expand Up @@ -402,10 +402,10 @@ void syscall_exec(u32 ebx, u32 ecx, u32 edx)
//free old process memory
free_process_memory(current_process);

//kprintf("%lSYS_EXEC : loading executable...\n", 3);
kprintf("%lSYS_EXEC : loading executable...\n", 3);
error_t load = load_executable(current_process, current_process->files[ebx], (int) ecx, argv);
if(load != ERROR_NONE) {kprintf("LOAD = %u\n", load); fatal_kernel_error("LOAD", "SYSCALL_EXEC");} //TEMP : just kill process
//kprintf("%lSYS_EXEC : executable loaded.\n", 3);
kprintf("%lSYS_EXEC : executable loaded.\n", 3);

//schedule to force reload eip/esp + registers that are in memory
__asm__ __volatile__("jmp schedule_switch"::"a"(current_process->active_thread), "d"(current_process));
Expand Down
Empty file modified tasking/processes/syscalls.h 100644 → 100755
Empty file.
Empty file modified tasking/processes/threads.c 100644 → 100755
Empty file.
Empty file modified tasking/scheduler/scheduler.c 100644 → 100755
Empty file.
Empty file modified tasking/scheduler/scheduler.s 100644 → 100755
Empty file.
Empty file modified tasking/task.h 100644 → 100755
Empty file.
Empty file modified time/time.c 100644 → 100755
Empty file.
Empty file modified time/time.h 100644 → 100755
Empty file.
Empty file modified util/data_structs.c 100644 → 100755
Empty file.
Empty file modified util/lib.c 100644 → 100755
Empty file.
Empty file modified util/types.h 100644 → 100755
Empty file.
Empty file modified util/util.h 100644 → 100755
Empty file.
44 changes: 29 additions & 15 deletions video/vga_text.c 100644 → 100755
Expand Up @@ -94,26 +94,33 @@ void vga_text_reset()
TEXT_CURSOR_Y = 0;
}

static void vga_text_scroll_up()
//static
void vga_text_scroll_up()
{
if(get_video_mode() != VIDEO_MODE_VGA_TEXT) return;
if(VIDEO_TYPE == VIDEO_TYPE_NONE) return;
unsigned char *VRAM, *tmp;
for (VRAM = VGA_MEM_START; VRAM < VGA_MEM_END; VRAM += 2)

u8* VRAM;
u8* tmp;
for (VRAM = VGA_MEM_START; (VRAM+1) < VGA_MEM_END; VRAM += 2)
{
tmp = (u8*) (VRAM + 160);
//assign temp position to start of next line
tmp = (u8*) (VRAM + VGA_COLUMNS*2);

//if temp position is in VRAM, put it back in previous line
if (tmp < VGA_MEM_END)
{
*VRAM = *tmp;
*(VRAM + 1) = *(tmp + 1);
VRAM[0] = tmp[0];
VRAM[1] = tmp[1];
}
else
//else this means that this line is the last, so we empty it
else
{
*VRAM = 0;
*(VRAM + 1) = 0x07;
VRAM[0] = 0;
VRAM[1] = 0x07;
}
}

if(TEXT_CURSOR_Y > 0)
TEXT_CURSOR_Y = (u8) (TEXT_CURSOR_Y - 1);
}
Expand Down Expand Up @@ -173,18 +180,25 @@ void vga_text_putc(unsigned char c, u8 color)
}
else
{
//get current video mem address and put char in it, + color if video mode = color
u8* CURRENT = (u8*) (VGA_MEM_START + 2 * TEXT_CURSOR_X + 2*VGA_COLUMNS * TEXT_CURSOR_Y);
*CURRENT = c;
if(VIDEO_TYPE == VIDEO_TYPE_COLOR) *(CURRENT+1) = color;
//update X
TEXT_CURSOR_X++;
if (TEXT_CURSOR_X > VGA_COLUMNS - 1)
{
TEXT_CURSOR_X = 0;
TEXT_CURSOR_Y++;
}
}

if (TEXT_CURSOR_Y > VGA_LINES - 1){vga_text_scroll_up();} //this actually causes the last line not to be used
//update text cursor X if line end reached
if(TEXT_CURSOR_X >= VGA_COLUMNS)
{
TEXT_CURSOR_X = 0;
TEXT_CURSOR_Y++;
}

//update text cursor Y if screen end reached
if(TEXT_CURSOR_Y >= (VGA_LINES)) vga_text_scroll_up(); //this actually causes the last line not to be used

//update vga cursor
vga_text_update_cursor();
}

Expand Down
Empty file modified video/video.c 100644 → 100755
Empty file.
Empty file modified video/video.h 100644 → 100755
Empty file.

0 comments on commit 541f85b

Please sign in to comment.