xaizek / tos (License: GPLv3 only) (since 2018-12-07)
This is an alternative version of sources presented as part of Write Your Own OS video tutorial by Viktor Engelmann.
Commit 4002e5a3439869cf5d4bce93a2feea8008c4be05

A couple of stylistic changes
Author: xaizek
Author date (UTC): 2018-04-12 13:55
Committer name: xaizek
Committer date (UTC): 2018-04-12 13:55
Parent(s): 3c3364de4f9eb02a15a7d175ca36482cdb4624ae
Signing key: 99DC5E4DB05F6BE2
Tree: 1ef21db0c4b0c553361340f8fb273d268db0e61f
File Lines added Lines deleted
Makefile 2 2
src/net/tcp.cpp 5 5
File Makefile changed (mode: 100644) (index 1981637..e81c3db)
... ... CXXFLAGS += -Wall -Wextra -Werror
9 9 CXXFLAGS += -fno-use-cxa-atexit -fno-builtin -fno-rtti -fno-exceptions CXXFLAGS += -fno-use-cxa-atexit -fno-builtin -fno-rtti -fno-exceptions
10 10 CXXFLAGS += -fno-threadsafe-statics CXXFLAGS += -fno-threadsafe-statics
11 11 ASFLAGS := -m32 ASFLAGS := -m32
12 LDFLAGS := -g -m32 -nostartfiles -nostdlib
12 LINKFLAGS := -g -m32 -nostartfiles -nostdlib
13 13 QEMUFLAGS := -netdev user,id=n0,hostfwd=udp::1234-:1234,hostfwd=tcp::1234-:1234 QEMUFLAGS := -netdev user,id=n0,hostfwd=udp::1234-:1234,hostfwd=tcp::1234-:1234
14 14 QEMUFLAGS += -device rtl8139,netdev=n0,mac=12:23:34:45:56:77 QEMUFLAGS += -device rtl8139,netdev=n0,mac=12:23:34:45:56:77
15 15 QEMUFLAGS += -drive file=./hda,index=0,media=disk,format=raw QEMUFLAGS += -drive file=./hda,index=0,media=disk,format=raw
 
... ... obj/%.o: src/%.S | $(dirs)
38 38 $(AS) $(ASFLAGS) -c -o $@ $< $(AS) $(ASFLAGS) -c -o $@ $<
39 39
40 40 kernel: linker.ld $(objects) kernel: linker.ld $(objects)
41 $(LD) $(LDFLAGS) -Wl,-T $< -o $@ $(objects)
41 $(CXX) $(LINKFLAGS) -Wl,-T $< -o $@ $(objects)
42 42
43 43 $(dirs): $(dirs):
44 44 mkdir -p $@ mkdir -p $@
File src/net/tcp.cpp changed (mode: 100644) (index 632b4e2..f301031)
... ... void
197 197 TCPProvider::send(TCPSocket &socket, span<const std::uint8_t> buf, TCPProvider::send(TCPSocket &socket, span<const std::uint8_t> buf,
198 198 TCPFlagsSubset flags) TCPFlagsSubset flags)
199 199 { {
200 uint16_t totalLength = buf.size() + TCPHeader::size();
201 uint16_t lengthInclPHdr = totalLength + TCPPseudoHeader::size();
200 std::uint16_t totalLength = buf.size() + TCPHeader::size();
201 std::uint16_t lengthInclPHdr = totalLength + TCPPseudoHeader::size();
202 202
203 203 std::unique_ptr<std::uint8_t[]> buffer(new std::uint8_t[lengthInclPHdr]); std::unique_ptr<std::uint8_t[]> buffer(new std::uint8_t[lengthInclPHdr]);
204 204
205 205 TCPPseudoHeader phdr(buffer.get()); TCPPseudoHeader phdr(buffer.get());
206 206 TCPHeader tcpHdr(buffer.get() + TCPPseudoHeader::size()); TCPHeader tcpHdr(buffer.get() + TCPPseudoHeader::size());
207 uint8_t *payload = buffer.get()
208 + TCPHeader::size()
209 + TCPPseudoHeader::size();
207 std::uint8_t *payload = buffer.get()
208 + TCPHeader::size()
209 + TCPPseudoHeader::size();
210 210
211 211 tcpHdr.offsetAndReserved = tcpHdr.offsetAndReserved =
212 212 netOrder(static_cast<std::uint8_t>(TCPHeader::size()/4 << 4)); netOrder(static_cast<std::uint8_t>(TCPHeader::size()/4 << 4));
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/tos

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/tos

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master