Commit Graph

26 Commits

Author SHA1 Message Date
Itamar
8a886e0e96 LibDebug: Parse line number information from DWARF format
DWARF line number information, if generated, is stored  in the
.debug_line section of an object file.

The information is encoded as instructions for a VM that is defined in
the DWARF specification.
By executing these instructions, we can extract the encoded line number
information.
2020-04-20 17:25:50 +02:00
Andreas Kling
7d862dd5fc AK: Reduce header dependency graph of String.h
String.h no longer pulls in StringView.h. We do this by moving a bunch
of String functions out-of-line.
2020-03-23 13:48:44 +01:00
Andreas Kling
88b9fcb976 AK: Use size_t for ByteBuffer sizes
This matches what we already do for string types.
2020-02-20 13:20:34 +01:00
Andreas Kling
0cff25ac78 AK+IPCCompiler: Get rid of BufferStream overloads for size_t
Since BufferStream is about creating specific binary stream formats,
let's not have a flaky type like size_t in there. Instead, clients of
BufferStream can cast their size_t to the binary size they want to use.

Account for this in IPCCompiler by making String lengths always 32-bit.
2020-02-05 19:13:44 +01:00
joshua stein
0c4c5b5eb7 AK: Support 64-bit integers in BufferStream 2020-02-05 18:39:45 +01:00
Andreas Kling
94ca55cefd Meta: Add license header to source files
As suggested by Joshua, this commit adds the 2-clause BSD license as a
comment block to the top of every source file.

For the first pass, I've just added myself for simplicity. I encourage
everyone to add themselves as copyright holders of any file they've
added or modified in some significant way. If I've added myself in
error somewhere, feel free to replace it with the appropriate copyright
holder instead.

Going forward, all new source files should include a license header.
2020-01-18 09:45:54 +01:00
Andreas Kling
6f4c380d95 AK: Use size_t for the length of strings
Using int was a mistake. This patch changes String, StringImpl,
StringView and StringBuilder to use size_t instead of int for lengths.
Obviously a lot of code needs to change as a result of this.
2019-12-09 17:51:21 +01:00
Andreas Kling
7aaea085de AK: Allow BufferStream to serialize/deserialize floats 2019-12-02 09:19:56 +01:00
Andreas Kling
73fdbba59c AK: Rename <AK/AKString.h> to <AK/String.h>
This was a workaround to be able to build on case-insensitive file
systems where it might get confused about <string.h> vs <String.h>.

Let's just not support building that way, so String.h can have an
objectively nicer name. :^)
2019-09-06 15:36:54 +02:00
Andreas Kling
18aeda2e0d BufferStream: It's not an error to read up to the very end of a buffer
Don't signal an error before we've reached the very end of the buffer.
2019-08-03 19:20:05 +02:00
Andreas Kling
6e956f2a0b BufferStream: Add operator<<(const char*) overload
Ext2FS was relying on the presence of a (StringView) overload here and
when I added a (bool) overload, it started choosing that for literals.
2019-08-03 19:02:48 +02:00
Andreas Kling
b04dae7faa BufferStream: Support "bool" as a streaming type 2019-08-03 17:02:42 +02:00
Robin Burchell
6e90f00925 BufferStream: Add a function to fully reset state
This will allow us to reuse the same buffer with the same stream instance.
Needed in AudioServer.
2019-07-16 09:36:38 +02:00
Robin Burchell
2c929c3aa1 BufferStream: Add signed int overloads for read/write
This will be required in AudioServer
2019-07-16 09:36:38 +02:00
Robin Burchell
7b75632e5c AK/LibAudio: Add stream read operators to AK::BufferStream, and use it in AWavLoader
At the same time, we allow chaining of streaming operators, and add a
way to check for partial reads (also used in WAV parsing).
2019-07-14 15:29:59 +02:00
Robin Burchell
3792883219 AK: Remove some superstition from BufferStream :) 2019-07-14 15:29:59 +02:00
Andreas Kling
27f699ef0c AK: Rename the common integer typedefs to make it obvious what they are.
These types can be picked up by including <AK/Types.h>:

* u8, u16, u32, u64 (unsigned)
* i8, i16, i32, i64 (signed)
2019-07-03 21:20:13 +02:00
Robin Burchell
7bce096afd Take StringView in more places
We should work towards a pattern where we take StringView as function
arguments, and store String as member, to push the String construction
to the last possible moment.
2019-06-02 12:55:51 +02:00
Andreas Kling
08926e59b3 Kernel: Add InodeFile, a File subclass for regular files.
Finally everything that can be held by a FileDescriptor actually inherits
from the File class.
2019-05-30 13:39:17 +02:00
Andreas Kling
fe2fa4ac80 DNSLookupServer: Start working on a userspace DNS resolver.
This doesn't have any server functionality just yet, but it does post
decent-looking DNS queries and parse the responses.
2019-03-19 16:29:06 +01:00
Andreas Kling
9624b54703 More moving towards using signed types.
I'm still feeling this out, but I am starting to like the general idea.
2019-02-25 22:06:55 +01:00
Andreas Kling
7f91aec25c Support font files.
This only works with the userspace build of SharedGraphics so far.
It's also very slow at loading fonts, but that's easy to fix.

Let's put fonts in /res/fonts/.
2019-02-02 23:13:12 +01:00
Andreas Kling
29dfb4ae13 Ext2FS: Factor out block list generation and writing into functions. 2019-01-23 03:03:44 +01:00
Andreas Kling
85b886c2e0 Make it possible to build the Kernel on a macOS host.
It still requires an ELF compiler and linker, but at least it builds.
I need to get rid of the "Unix" namespace. This does a lot of that.
2018-12-02 23:34:50 +01:00
Andreas Kling
19b9401487 Reduce kmalloc() traffic in directory iteration.
Pass the file name in a stack-allocated buffer instead of using an AK::String
when iterating directories. This dramatically reduces the amount of cycles
spent traversing the filesystem.
2018-11-13 00:17:30 +01:00
Andreas Kling
bca4b71bfa Lots of hacking to make a very simple "ls" utility.
I added a dead-simple malloc that only allows allocations < 4096 bytes.
It just forwards the request to mmap() every time.

I also added simplified versions of opendir() and readdir().
2018-10-24 12:50:07 +02:00