Skip to content
Snippets Groups Projects
Commit a9962197 authored by Byron Lathi's avatar Byron Lathi
Browse files

add ls and update shell

parent f542d723
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,7 @@ CFLAGS += -Wall -nostdlib -ffreestanding -m32 -g
LDFLAGS += -nostdlib -ffreestanding -m32
CC=i686-elf-gcc
SRC = hello exectest read shell
SRC = hello exectest read shell ls
.SUFFIXES:
......
#include "syscall.h"
int main()
{
uint8_t path[64];
sys_write(1, "Type filename: ", 15);
sys_read(0, path, 64);
int fd = sys_open(path);
sys_write(1, "Got fd ", 7);
char fdc = fd + '0';
sys_write(1, &fdc, 1);
sys_write(1, "\n", 1);
return 0;
}
\ No newline at end of file
......@@ -6,6 +6,7 @@ int main()
uint8_t test[64];
int ret;
while (1){
sys_write(1, "summerOS> ", 10);
sys_read(0, test, 64);
ret = sys_exec(test);
if (ret) {
......
......@@ -20,6 +20,7 @@ int32_t sys_write(int32_t fd, const void* buf, int32_t len)
int32_t sys_open(uint8_t* name)
{
printf("sys_open\n");
return -1;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment