Skip to content

Commit c97edba

Browse files
authored
Merge pull request #18 from dark-tree/fd
File system, syscalls, and everything nice
2 parents d17acea + 00f23b4 commit c97edba

Some content is hidden

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

49 files changed

+6432
-90
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
build/
22
output
3+
src/kernel/systable.h

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,15 @@
66
# First install QEMU
77
sudo apt install qemu-system
88

9-
# Build all
9+
# Build all and generate the image with filesystem
1010
make all
1111

1212
# Start the system in VM
1313
make run
1414

1515
# Start the system in VM with attached GDB
1616
make debug
17+
18+
# Generate the floppy disk image with filesystem
19+
make image
1720
```

disks/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
floppy.img
2+
viewer/build
3+

disks/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
### Usage
2+
Create floppy disk image with the contents of the `files` directory.
3+
```bash
4+
make image
5+
```
6+
Build simple file browser, which allows to view the contents of the floppy disk image.
7+
```bash
8+
make build
9+
```
10+
Build and run the file browser.
11+
```bash
12+
make run
13+
```
14+
Generate image and run the file browser.
15+
```bash
16+
make all
17+
```

disks/files/executable/elf-pic

636 KB
Binary file not shown.

disks/files/readme.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Contents of this "files" directory will be loaded into a FAT floppy disk image.

disks/files/tmp/haha.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Haha content!

disks/makefile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
.PHONY : all clean image build run
2+
3+
all: image run
4+
5+
image: build
6+
@echo "Creating floppy image..."
7+
dd if=/dev/zero of=floppy.img count=1440 bs=1k
8+
mkfs.msdos -F 32 floppy.img
9+
viewer/build/main -l
10+
11+
build:
12+
@echo "Building..."
13+
if [ ! -d "viewer/build" ]; then mkdir viewer/build; fi
14+
gcc viewer/main.c ../src/kernel/fat.c -I../src/kernel -o viewer/build/main
15+
16+
clean:
17+
@echo "Cleaning up..."
18+
rm -rf viewer/build
19+
rm -f floppy.img
20+
21+
run: build
22+
@echo "Running..."
23+
viewer/build/main
24+

0 commit comments

Comments
 (0)