Pārlūkot izejas kodu

Add /bin/false and /bin/true for fun. :^)

Andreas Kling 6 gadi atpakaļ
vecāks
revīzija
3faaa3e04a
6 mainītis faili ar 24 papildinājumiem un 2 dzēšanām
  1. BIN
      Kernel/_fs_contents
  2. 2 0
      Kernel/sync-sh
  3. 2 0
      Userland/.gitignore
  4. 12 2
      Userland/Makefile
  5. 4 0
      Userland/false.cpp
  6. 4 0
      Userland/true.cpp

BIN
Kernel/_fs_contents


+ 2 - 0
Kernel/sync-sh

@@ -7,5 +7,7 @@ cp ../Userland/ls mnt/bin/ls
 cp ../Userland/pwd mnt/bin/pwd
 cp ../Userland/sleep mnt/bin/sleep
 cp ../Userland/date mnt/bin/date
+cp ../Userland/true mnt/bin/true
+cp ../Userland/false mnt/bin/false
 umount mnt
 sync

+ 2 - 0
Userland/.gitignore

@@ -5,4 +5,6 @@ ls
 pwd
 sleep
 date
+false
+true
 *.o

+ 12 - 2
Userland/Makefile

@@ -5,7 +5,9 @@ OBJS = \
        ls.o \
        pwd.o \
        sleep.o \
-       date.o
+       date.o \
+       true.o \
+       false.o
 
 APPS = \
        id \
@@ -14,7 +16,9 @@ APPS = \
        ls \
        pwd \
        sleep \
-       date
+       date \
+       true \
+       false
 
 ARCH_FLAGS =
 STANDARD_FLAGS = -std=c++17 -nostdinc++ -nostdlib
@@ -55,6 +59,12 @@ sleep: sleep.o
 date: date.o
 	$(LD) -o $@ $(LDFLAGS) $< ../LibC/LibC.a
 
+true: true.o
+	$(LD) -o $@ $(LDFLAGS) $< ../LibC/LibC.a
+
+false: false.o
+	$(LD) -o $@ $(LDFLAGS) $< ../LibC/LibC.a
+
 .cpp.o:
 	@echo "CXX $<"; $(CXX) $(CXXFLAGS) -o $@ -c $<
 

+ 4 - 0
Userland/false.cpp

@@ -0,0 +1,4 @@
+int main()
+{
+    return 1;
+}

+ 4 - 0
Userland/true.cpp

@@ -0,0 +1,4 @@
+int main()
+{
+    return 0;
+}