Commit Graph

48 Commits

Author SHA1 Message Date
Shannon Booth
fe668db999 Meta: Fix shellcheck warnings in various scripts
Warnings fixed:
 * SC2086: Double quote to prevent globbing and word splitting.
 * SC2006: Use $(...) notation instead of legacy backticked `...`
 * SC2039: In POSIX sh, echo flags are undefined
 * SC2209: Use var=$(command) to assign output (or quote to assign string)
 * SC2164: Use 'cd ... || exit' or 'cd ... || return' in case cd fails
 * SC2166: Prefer [ p ] && [ q ] as [ p -a q ] is not well defined.
 * SC2034: i appears unused. Verify use (or export if used externally)
 * SC2046: Quote this to prevent word splitting.
 * SC2236: Use -z instead of ! -n.

There are still a lot of warnings in Kernel/run about:
 - SC2086: Double quote to prevent globbing and word splitting.

However, splitting on space is intentional in this case, and not trivial to
change. Therefore ignore the warning for now - but we should fix this in
the future.
2020-02-10 10:46:25 +01:00
Andreas Kling
6c752c15a2 WebServer: Implement a very basic HTTP server :^)
This server listens on port 8000 and serves HTML files from /www.
It's very simple and quite naive, but I think we can start here and
build our way to something pretty neat.

Work towards #792.
2020-02-09 14:15:55 +01:00
Andreas Kling
806f19d647 run: Bump default RAM size from 128 MB to 256 MB 2020-01-15 23:14:20 +01:00
Liav A
bd3b64efb7 Kernel: Fix run script to enable networking on Q35 machines
Also, we enable KVM to accelerate the execution when booting with
q35_cmd or qcmd options in the run script.
2020-01-14 15:38:58 +01:00
Liav A
2a4a19aed8 Kernel: Fixing PCI MMIO access mechanism
During initialization of PCI MMIO access mechanism we ensure that we
have an allocation from the kernel virtual address space that cannot be
taken by other components in the OS.
Also, now we ensure that interrupts are disabled so mapping the region
doesn't fail.
In order to reduce overhead, map_device() will map the requested PCI
address only if it's not mapped already.

The run script has been changed so now we can boot a Q35 machine, that
supports PCI ECAM.
To ensure we will be able to load the machine, a PIIX3 IDE controller
was added to the Q35 machine configuration in the run script.
An AHCI controller was added to the i440fx machine configuration.
2020-01-02 21:45:04 +01:00
Andreas Kling
fed3416bd2 Kernel: Embrace the SerenityOS name 2019-12-29 19:08:02 +01:00
Andreas Kling
aeefcd6ddb run: Run QEMU with "-cpu max"
This should give us access to the largest set of CPU features available
on the host machine.
2019-12-25 15:19:13 +01:00
Shannon Booth
ef6eb07468 Build: Meta: Allow makeall.sh and run to be called from any directory
These scripts assume that they are called from within Kernel/ directory.
For convenience, set the current working directory in the scripts to the
path where they are located.
2019-12-24 02:19:59 +01:00
Conrad Pankoff
131f14ed62 Meta: Add environment variable to specify bochs command in run script 2019-12-23 23:11:57 +01:00
Andreas Kling
cb6a00c512 Run: Fix broken packet logging argument to QEMU (disabled by default) 2019-12-22 15:56:16 +01:00
Andreas Kling
dd1996ca68 run: Unbreak this script when running with a regular Bourne /bin/sh
We can't use bashisms in our scripts anymore, since we're trying to
keep them POSIXy (to make them easier to run for our own shell someday)
2019-11-13 21:57:51 +01:00
supercomputer7
4fe2ee0221 Kernel: Add a kernel boot parameter to force PIO mode
Also added an option in the run script to force PIO operation mode with
the IDE controller.
In addition, we're no longer limited to PIIX3 and PIIX4 chipsets for DMA
2019-11-13 18:30:25 +01:00
Andreas Kling
3de3daf765 run: Unbreak the run script 2019-11-05 18:56:43 +01:00
Dan MacDonald
17752b2973 run: Comment out qemu packet capture 2019-11-05 18:07:49 +01:00
Andreas Kling
e4c80961d9 run: Only enable KVM if /dev/kvm is r/w for the current user 2019-11-04 13:04:02 +01:00
Jonathan Archer
cddbb7fdd7 Run: Don't repeat common QEMU arguments 2019-11-02 21:46:00 +01:00
Jonathan Archer
9cad242590 Run: Properly use common memory size 2019-11-02 21:46:00 +01:00
Liav A
ed45f67c00 Kernel: Enabling Text mode debugging (#696)
Also added an option to start Serenity with text mode in QEMU
in the run script.
2019-10-29 16:41:40 +01:00
Andreas Kling
16e66716ba Runner: Enable QEMU's KVM mode by default
This makes QEMU run significantly faster on Linux systems with KVM.
2019-10-13 15:07:23 +02:00
Andreas Kling
b07cf6843e Runner: Forward host TCP port 8823 to guest port 23 in QEMU
This makes it easier to test TelnetServer when running in QEMU.
2019-09-09 09:19:43 +02:00
Conrad Pankoff
93c16590f1 Kernel: Remove specific devices from network code
By setting up the devices in init() and looping over the registered
network adapters in NetworkTask_main, we can remove the remaining
hard-coded adapter references from the network code.

This also assigns IPs according to the default range supplied by QEMU
in its slirp networking mode.
2019-08-29 06:25:06 +02:00
Robin Burchell
6c4024c04a Kernel: First cut of a sb16 driver
Also add an AudioServer that (right now) doesn't do much.
It tries to open, parse, and play a wav file. In the future, it can do more.

My general thinking here here is that /dev/audio will be "owned" by AudioServer,
and we'll do mixing in software before passing buffers off to the kernel
to play, but we have to start somewhere.
2019-07-13 08:00:24 +02:00
Robin Burchell
0a3abcc0a8 Kernel: Expose kernel command line to userspace through /proc/cmdline 2019-06-16 14:33:59 +02:00
Conrad Pankoff
8df44b476d Kernel: Use an environment variable to set the memory size in the run script 2019-06-12 15:38:17 +02:00
Conrad Pankoff
e1c982e4db Build: Remove grub from default build process
This removes grub and all the loopback device business from the default
build process. Running grub takes about a second, and it turns out it's
inconsistently packaged in different distributions, which has led to
at least one confusing issue so far (grub-install vs grub2-install).
Removing it from the basic path will make it easier for people to try
Serenity out.

There are now two scripts that can be used to build a disk image:

1. `build-image-grub.sh` - this will build an image suitable for writing
   to the IDE hard drive of a physical machine, complete with a partition
   table and bootloader. This can be run in qemu with the `qgrub` target
   for the `run` script.
2. `build-image-qemu.sh` - this is a simpler script which creates a bare
   filesystem image rather than a full MBR disk.

Both of these call out to `build-root-filesystem.sh` to do most of the
work setting up... the root filesystem.

For completeness' sake, I've retained the `sync.sh` script as a simple
forwarding to `build-image-qemu.sh`.

This relies on the functionality from #194 and #195. #195 allows us to
use `/dev/hda` as the root device when nothing else is specified, and #194
works around a strange feature of qemu that appends a space to the kernel
command line.
2019-06-04 07:15:44 -07:00
Conrad Pankoff
6f43f81fb4 Kernel: Implement OffsetDiskDevice to prepare for partition support
This implements a passthrough disk driver that translates the read/write
block addresses by a fixed offset. This could form the basis of MBR
partition support if we were to parse the MBR table at boot and create that
OffsetDiskDevice dynamically, rather than seeking to a fixed offset.

This also introduces a dependency in the form of grub. You'll need to have
32-bit grub binaries installed to build the project now.

As a bonus, divorcing Serenity from qemu's kernel loading means we can now
*technically* boot on real hardware. It just... doesn't get very far yet.
If you write the `_disk_image` file to an IDE hard drive and boot it in a
machine that supports all the basic PC hardware, it *will* start loading
the kernel.
2019-06-02 12:37:29 +02:00
Andreas Kling
4320c5fd58 Kernel: Make better use of the multiboot info.
Define the multiboot info struct properly so we don't have to grab at byte
offsets in the memory access checker code. Also print kernel command line
in init().
2019-06-02 09:53:42 +02:00
Andreas Kling
abbcdba72e WindowServer: Add 2560x1440 resolution option.
Also expand the QEMU VGA memory size to 64 MB, since otherwise we won't
have enough memory for double-buffering the screen.
2019-05-24 14:02:17 +02:00
Andreas Kling
fba57d6ba3 Always run QEMU with -debugcon stdio.
If someone wants to run without this, they can disable it manually :^)
2019-05-23 20:57:32 +02:00
Andreas Kling
45230a9544 Run QEMU with the "guest_errors" debug flag, in case we do something wrong. 2019-05-17 18:19:03 +02:00
Andreas Kling
c56e3ebee1 Always dump QEMU CPU state on CPU reset. 2019-05-17 00:06:23 +02:00
Andreas Kling
3cba2a8a78 Kernel: Add a beep() syscall that beeps the PC speaker.
Hook this up in Terminal so that the '\a' character generates a beep.
Finally emit an '\a' character in the shell line editing code when
backspacing at the start of the line.
2019-05-15 21:40:41 +02:00
Andreas Kling
f137881147 run: Make it easy to override which qemu executable is used.
Patch contributed by "pd"
2019-05-04 02:52:51 +02:00
Mustafa Ali CAN
9fa8324f7a Fix jittery mouse 2019-05-01 21:54:41 +02:00
Andreas Kling
16f6a3af3c Allow passing extra args to qemu via a SERENITY_EXTRA_QEMU_ARGS env var. 2019-04-24 21:06:16 +02:00
Andreas Kling
ee4d7c18c8 Kernel: Use a multiboot header instead of a convoluted two-part bootloader.
The old bootloader was hilariously complicated, requiring a floppy disk with
the kernel on it, and a hard drive with the file system. This patch removes
the floppy disk from the equation and replaces it with a multiboot header.
This means the kernel can now be booted with qemu-system-i386 -kernel kernel
2019-04-01 21:43:07 +02:00
Andreas Kling
5808322556 Give the emulator testing environments 128 MB of RAM.
I'm working on porting GCC and it needs a fair bit of memory to run.
2019-03-27 13:02:29 +01:00
Andreas Kling
c588653f76 IPv4: Begin fleshing out TCP support. 2019-03-13 17:17:07 +01:00
Andreas Kling
cf250e1245 More work on IPv4 sockets and /bin/ping.
It's now actually possible to ping other hosts on the network! :^)
I've switched the "run" script over to starting QEMU with user networking
since that works better for my testing needs right now.
2019-03-13 03:26:01 +01:00
Andreas Kling
318b01e055 Kernel: Bring up enough networking code that we can respond to ARP requests.
This is all pretty rickety but we can now respond to "arping" from the host
while running inside QEMU. Very cool. :^)
2019-03-11 23:21:38 +01:00
Andreas Kling
35098cbde1 Kernel: Add a NetworkTask and a received network packet queue.
It will be easier to deal with incoming packets in a separate task.
2019-03-11 12:43:45 +01:00
Andreas Kling
405413c354 Kernel: Start adding support for E1000 network adapters. 2019-03-10 15:25:33 +01:00
Andreas Kling
ac7a60225e Add TIOCGWINSZ ioctl so userland can determine terminal geometry.
(Don't) use this to implement short-form output in ls.
I'm too tired to make a nice column formatting algorithm.
I just wanted something concise when I type "ls".
2018-11-29 03:45:23 +01:00
Andreas Kling
de38e63d3e Run QEMU with the possibility to attach gdb. 2018-11-09 18:35:32 +01:00
Andreas Kling
71a2942a0a Make it run in QEMU.
Looks like the problem was the weirdly-sized floppy image file.
I guess QEMU was inferring the floppy disk geometry from the image size.
2018-11-08 02:03:19 +01:00
Andreas Kling
286e27ef40 Allow running in QEMU with "./run q"
The kernel doesn't run in QEMU right now and I don't know why.
2018-10-17 16:58:35 +02:00
Andreas Kling
9171521752 Integrate ext2 from VFS into Kernel. 2018-10-17 10:57:23 +02:00
Andreas Kling
9396108034 Import the "gerbert" kernel I worked on earlier this year.
It's a lot crappier than I remembered it. It's gonna need a lot of work.
2018-10-16 11:02:00 +02:00