diff --git a/Kernel/FileSystem/ProcFS.cpp b/Kernel/FileSystem/ProcFS.cpp index c042b5abb78..cbcb422dda0 100644 --- a/Kernel/FileSystem/ProcFS.cpp +++ b/Kernel/FileSystem/ProcFS.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -41,6 +42,7 @@ enum ProcFileType { FI_Root_dmesg, FI_Root_pci, FI_Root_uptime, + FI_Root_cmdline, FI_Root_netadapters, FI_Root_self, // symlink FI_Root_sys, // directory @@ -253,6 +255,13 @@ ByteBuffer procfs$uptime(InodeIdentifier) return builder.to_byte_buffer(); } +ByteBuffer procfs$cmdline(InodeIdentifier) +{ + StringBuilder builder; + builder.appendf("%s\n", KParams::the().cmdline().characters()); + return builder.to_byte_buffer(); +} + ByteBuffer procfs$netadapters(InodeIdentifier) { StringBuilder builder; @@ -1113,6 +1122,7 @@ ProcFS::ProcFS() m_entries[FI_Root_self] = { "self", FI_Root_self, procfs$self }; m_entries[FI_Root_pci] = { "pci", FI_Root_pci, procfs$pci }; m_entries[FI_Root_uptime] = { "uptime", FI_Root_uptime, procfs$uptime }; + m_entries[FI_Root_cmdline] = { "cmdline", FI_Root_cmdline, procfs$cmdline }; m_entries[FI_Root_netadapters] = { "netadapters", FI_Root_netadapters, procfs$netadapters }; m_entries[FI_Root_sys] = { "sys", FI_Root_sys }; diff --git a/Kernel/run b/Kernel/run index db3414fa45a..056a2713c7e 100755 --- a/Kernel/run +++ b/Kernel/run @@ -2,7 +2,7 @@ [ -z "$SERENITY_QEMU_BIN" ] && SERENITY_QEMU_BIN="qemu-system-i386" -SERENITY_KERNEL_CMDLINE="hello" +[ -z "$SERENITY_KERNEL_CMDLINE" ] && SERENITY_KERNEL_CMDLINE="hello" export SDL_VIDEO_X11_DGAMOUSE=0 @@ -18,6 +18,7 @@ elif [ "$1" = "qn" ]; then -debugcon stdio \ -device e1000 \ -kernel kernel \ + -append "${SERENITY_KERNEL_CMDLINE}" \ -hda _disk_image \ -soundhw pcspk elif [ "$1" = "qtap" ]; then @@ -31,6 +32,7 @@ elif [ "$1" = "qtap" ]; then -netdev tap,ifname=tap0,id=br0 \ -device e1000,netdev=br0 \ -kernel kernel \ + -append "${SERENITY_KERNEL_CMDLINE}" \ -hda _disk_image \ -soundhw pcspk elif [ "$1" = "qgrub" ]; then @@ -56,6 +58,7 @@ else -netdev user,id=breh,hostfwd=tcp:127.0.0.1:8888-192.168.5.2:8888 \ -device e1000,netdev=breh \ -kernel kernel \ + -append "${SERENITY_KERNEL_CMDLINE}" \ -hda _disk_image \ -soundhw pcspk fi