Giter Site home page Giter Site logo

srg-ics-uplb / ics-os Goto Github PK

View Code? Open in Web Editor NEW
13.0 13.0 86.0 26.13 MB

An instructional operating system

C 95.62% Shell 0.02% Makefile 0.24% Assembly 2.12% Batchfile 0.03% Dockerfile 0.01% TeX 1.96%
boot i386 instructional-operating-system instructional-operating-systems kernel operating-system operating-systems os osdev teaching-kernel x86

ics-os's Issues

How to do file i/o in kernel mode?

Here's a demo:

void kernel_file_io_demo(){
   char msg[10]="Hello!";
   char buf[10];
   file_PCB *fp;

   fp=openfilex("sample.txt",FILE_WRITE);
   fwrite(msg,sizeof(msg),1,fp);
   fclose(fp);

   fp=openfilex("sample.txt",FILE_READ);
   fread(buf,sizeof(msg),1,fp);
   printf("%s\n",buf);
   fclose(fp);

}

ICS OS fails to compile in the GNU C Compiler versions 5.0 and above

ICS OS fails to compile in the GNU C Compiler versions 5.0 and above.

The linker seems to be unable to find references to inline functions.

The following is the output in the terminal when running make:

make -C kernel/
make[1]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
make[1]: Entering directory '/home/skeithc/Codes/C/ics-os2/ics-os/kernel'
gcc -m32 -w -nostdlib -fno-builtin -ffreestanding -c -o scheduler.o process/scheduler.c
gcc -m32 -w -nostdlib -fno-builtin -ffreestanding -c -o fat.o filesystem/fat12.c
gcc -m32 -w -nostdlib -fno-builtin -ffreestanding -c -o iso9660.o filesystem/iso9660.c
gcc -m32 -w -nostdlib -fno-builtin -ffreestanding -c -o devfs.o filesystem/devfs.c
gcc -m32 -w -nostdlib -fno-builtin -ffreestanding -c -o iomgr.o iomgr/iosched.c
gcc -m32 -w -nostdlib -fno-builtin -ffreestanding -c -o devmgr_error.o devmgr/devmgr_error.c
gcc -m32 -w -nostdlib -fno-builtin -ffreestanding -c -o kernel32.o kernel32.c 
nasm -f elf32 -o startup.o startup/startup.asm
nasm -f elf32 -o asmlib.o startup/asmlib.asm 
startup/asmlib.asm:300: warning: label alone on a line without a colon might be in error
nasm -f elf32 -o irqwrap.o irqwrap.asm
strip --strip-debug *.o
ld -melf_i386  -T lscript.txt -Map mapfile.txt

kernel32.o: In function `ports_write':
(.text+0x16e): undefined reference to `outportw'
kernel32.o: In function `ports_read':
(.text+0x1f0): undefined reference to `inportw'
kernel32.o: In function `read_regs':
(.text+0x2e6): undefined reference to `inportb'
kernel32.o: In function `read_regs':
(.text+0x311): undefined reference to `outportb'
kernel32.o: In function `read_regs':
(.text+0x321): undefined reference to `inportb'
kernel32.o: In function `read_regs':
(.text+0x356): undefined reference to `outportb'
kernel32.o: In function `read_regs':
(.text+0x366): undefined reference to `inportb'
kernel32.o: In function `read_regs':
(.text+0x39b): undefined reference to `outportb'
...
Makefile:47: recipe for target 'Kernel32.bin' failed
make[1]: *** [Kernel32.bin] Error 1
make[1]: Leaving directory '/home/skeithc/Codes/C/ics-os2/ics-os/kernel'
Makefile:7: recipe for target 'vmdex' failed
make: *** [vmdex] Error 2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.