Skip to content

Commit c05018a

Browse files
author
John Smith
committed
Added preliminary ext2 file system
Fixed the floppy disk read and write functions Added preliminary ext2 file system which can: Create the headers for the file system (superblock, group descriptor, etc.) Read and edit them Added instructions on how to make the initrd Added a list of TODO parts that have been started but not completed
1 parent 18d732d commit c05018a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+1220
-442
lines changed

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
#any temporary files that libre office has
22
.~lock.*
3+
34
#custom scripts for my IDE
45
my_*
6+
7+
#ignore backup files created by my IDE
8+
\#*\#
9+
.#*
10+
*emacs*

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Makefile
22
#
3-
# Copyright 2013 JS <js@duck-squirell>
3+
# Copyright 2013 JS-OS <js@duck-squirell>
44
#
55
# This program is free software; you can redistribute it and/or modify
66
# it under the terms of the GNU General Public License as published by

README/MAKE_INITRD

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
To create the initrd of JS-OS on a unix-like operating system, use the script 'make_initrd.sh' in the directory <file_path>/JS-OS/initrd/. The usage is as follows:
2+
3+
If there is a file, for example 'test.txt' to create an initrd of it, type:
4+
./make_initrd.sh test.txt <what you want the file to be called in the initrd>
5+
6+
For example: './make_initrd.sh test.txt text_file', the initrd will be edited with 'test.txt' in it and will have the name 'text_file' in the initrd itself.
7+
8+
./make_initrd supports multiple files by stringing the arguments.
9+
For example two files to initrd: './make_initrd file1 name1 file2 name2' ...ect.

README/TODO

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Items that need to be completed include:
2+
3+
ELF execution
4+
fopen and fclose for the vfs

core/arch/boot.asm

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; boot.asm
22
;
3-
; Copyright 2013 JS <js@duck-squirell>
3+
; Copyright 2013 JS-OS <js@duck-squirell>
44
;
55
; This program is free software; you can redistribute it and/or modify
66
; it under the terms of the GNU General Public License as published by

core/arch/common.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* common.c
33
*
4-
* Copyright 2013 JS <js@duck-squirell>
4+
* Copyright 2013 JS-OS <js@duck-squirell>
55
*
66
* This program is free software; you can redistribute it and/or modify
77
* it under the terms of the GNU General Public License as published by

core/arch/cpu.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* cpu.c
33
*
4-
* Copyright 2013 JS <js@duck-squirell>
4+
* Copyright 2013 JS-OS <js@duck-squirell>
55
*
66
* This program is free software; you can redistribute it and/or modify
77
* it under the terms of the GNU General Public License as published by

core/arch/descriptor_tables.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* descriptor_tables.c
33
*
4-
* Copyright 2013 JS <js@duck-squirell>
4+
* Copyright 2013 JS-OS <js@duck-squirell>
55
*
66
* This program is free software; you can redistribute it and/or modify
77
* it under the terms of the GNU General Public License as published by

core/arch/gdt.asm

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; gdt.asm
22
;
3-
; Copyright 2013 JS <js@duck-squirell>
3+
; Copyright 2013 JS-OS <js@duck-squirell>
44
;
55
; This program is free software; you can redistribute it and/or modify
66
; it under the terms of the GNU General Public License as published by

core/arch/interrupt.asm

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; interrupt.asm
22
;
3-
; Copyright 2013 JS <js@duck-squirell>
3+
; Copyright 2013 JS-OS <js@duck-squirell>
44
;
55
; This program is free software; you can redistribute it and/or modify
66
; it under the terms of the GNU General Public License as published by

core/arch/isr.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* isr.c
33
*
4-
* Copyright 2013 JS <js@duck-squirell>
4+
* Copyright 2013 JS-OS <js@duck-squirell>
55
*
66
* This program is free software; you can redistribute it and/or modify
77
* it under the terms of the GNU General Public License as published by

core/arch/kheap.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* kheap.c
33
*
4-
* Copyright 2013 JS <js@duck-squirell>
4+
* Copyright 2013 JS-OS <js@duck-squirell>
55
*
66
* This program is free software; you can redistribute it and/or modify
77
* it under the terms of the GNU General Public License as published by

core/arch/paging.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* paging.c
33
*
4-
* Copyright 2013 JS <js@duck-squirell>
4+
* Copyright 2013 JS-OS <js@duck-squirell>
55
*
66
* This program is free software; you can redistribute it and/or modify
77
* it under the terms of the GNU General Public License as published by

core/arch/process.asm

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; process.asm
22
;
3-
; Copyright 2013 JS <js@duck-squirell>
3+
; Copyright 2013 JS-OS <js@duck-squirell>
44
;
55
; This program is free software; you can redistribute it and/or modify
66
; it under the terms of the GNU General Public License as published by

core/arch/task.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* task.c
33
*
4-
* Copyright 2013 JS <js@duck-squirel>
4+
* Copyright 2013 JS-OS <js@duck-squirel>
55
*
66
* This program is free software; you can redistribute it and/or modify
77
* it under the terms of the GNU General Public License as published by

core/arch/timer.c

+26-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* timer.c
33
*
4-
* Copyright 2013 JS <js@duck-squirell>
4+
* Copyright 2013 JS-OS <js@duck-squirell>
55
*
66
* This program is free software; you can redistribute it and/or modify
77
* it under the terms of the GNU General Public License as published by
@@ -110,7 +110,7 @@ void init_timer(u32int frequency)
110110

111111
/*================RTC===================*/
112112

113-
#define BCD2BIN(bcd) ((((bcd)&15) + ((bcd)>>4)*10))
113+
#define BCD2BIN(bcd) ((((bcd) & 15) + ((bcd) >> 4) * 10))
114114
#define MINUTE 60
115115
#define HOUR (60*MINUTE)
116116
#define DAY (24*HOUR)
@@ -128,7 +128,31 @@ datetime_t getDatetime()
128128
now.day = BCD2BIN(readCMOS(0x7));
129129
now.month = BCD2BIN(readCMOS(0x8));
130130
now.year = BCD2BIN(readCMOS(0x9));
131+
now.century = BCD2BIN(readCMOS(0x32));
131132
asm volatile("sti");
132133

133134
return now;
134135
}
136+
137+
/*================Convertor to POSIX===================*/
138+
139+
#define Y_TO_SECS(y) (31556000 * y) //there are 31,556,000 seconds in a year (this accounts for a leap year every 4 years)
140+
#define MO_TO_SECS(m) (2629667 * m) //approximation of the amount of seconds per month as the length of a month is not constant
141+
#define D_TO_SECS(d) (86400 * d) //seconds in a day
142+
#define H_TO_SECS(h) (3600 * h) //seconds in an hour
143+
#define MIN_TO_SECS(min) (60 * min) //seconds in a minute
144+
145+
u32int posix_time()
146+
{
147+
datetime_t time;
148+
u32int years_passed;
149+
150+
time = getDatetime();
151+
152+
//calculate the time pased since the begining of POSIX
153+
years_passed = (time.century * 100 + time.year) - POSIX_YEAR;
154+
155+
//convert the RTC times to seconds and sum everything up
156+
return Y_TO_SECS(years_passed) + MO_TO_SECS(time.month) + D_TO_SECS(time.day) + H_TO_SECS(time.hour) + MIN_TO_SECS(time.min) + time.sec;
157+
158+
}

core/arch/v86.asm

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; v86.asm
22
;
3-
; Copyright 2013 JS <js@duck-squirell>
3+
; Copyright 2013 JS-OS <js@duck-squirell>
44
;
55
; This program is free software; you can redistribute it and/or modify
66
; it under the terms of the GNU General Public License as published by

core/elf.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* elf.c
33
*
4-
* Copyright 2013 JS <js@duck-squirell>
4+
* Copyright 2013 JS-OS <js@duck-squirell>
55
*
66
* This program is free software; you can redistribute it and/or modify
77
* it under the terms of the GNU General Public License as published by

0 commit comments

Comments
 (0)