Overall repository cleanup #5

Open
opened 2023-10-19 16:29:41 +03:00 by sateallia · 20 comments
Owner

This is entirely on me, I'll do it.

This is entirely on me, I'll do it.
sateallia added the
enhancement
label 2023-10-19 16:29:41 +03:00
sateallia self-assigned this 2023-10-19 16:29:41 +03:00
Author
Owner

As said in #11 we should modularize code and stop repeating it in folders. One such example of this is that there is an implementation of strlen in arch/aarch64 which should ideally be imported from libc.

As said in https://git.homd.xyz/asagiri/asagiri/issues/11 we should modularize code and stop repeating it in folders. One such example of this is that there is an implementation of strlen in arch/aarch64 which should ideally be imported from libc.
FMudanyali was assigned by sateallia 2023-10-22 02:47:56 +03:00
Author
Owner

This is almost completely done, only thing I now see are the compile-toolchain script and the Makefile only targetting aarch64 (RPi3 to be exact), the aarch64 linker script being aligned by 4K only, hardcoded offsets in arch/aarch64/uart.c and the presence of the u-boot folder.

This is almost completely done, only thing I now see are the compile-toolchain script and the Makefile only targetting aarch64 (RPi3 to be exact), the aarch64 linker script being aligned by 4K only, hardcoded offsets in arch/aarch64/uart.c and the presence of the u-boot folder.
Owner

fixed all warnings with 2107ea43ff besides mmio_read and mmio_write

fixed all warnings with 2107ea43fff7ec949c83ff20b3d47f3dbf2a94b0 besides mmio_read and mmio_write
Author
Owner

Fixed all the remaining warnings including the linker ones. All that remains are some hard coded values.

Fixed all the remaining warnings including the linker ones. All that remains are some hard coded values.
Author
Owner

-pedantic will introduce more warnings, @FMudanyali :)

-pedantic will introduce more warnings, @FMudanyali :)
Author
Owner

Can we also deduplicate the logic between toolchain make include files? CFLAGS and LDFLAGS in general are kinda dirty right now.

Can we also deduplicate the logic between toolchain make include files? CFLAGS and LDFLAGS in general are kinda dirty right now.
Owner

-pedantic will introduce more warnings, @FMudanyali :)

done with #22, I went ahead and also added -Wshadow and -Wstrict-aliasing.

> -pedantic will introduce more warnings, @FMudanyali :) done with #22, I went ahead and also added -Wshadow and -Wstrict-aliasing.
Owner

On another note, first I tried C89 and changed all // comments with /**/, then later realized C89 does not support variable sized arrays and that is really not good, but i also didn't want to revert changes on comments so I may have declared the usage of /**/ for all comments in the projects' coding convention.

On another note, first I tried C89 and changed all // comments with /\*\*/, then later realized C89 does not support variable sized arrays and that is really not good, but i also didn't want to revert changes on comments so I may have declared the usage of /\*\*/ for all comments in the projects' coding convention.
Owner

tbh it looks nicer that way...
... ...😭

tbh it looks nicer that way... ... ...😭
Owner

Integrated clang-format with custom config in 722d59a3e0
Added a git hook and script to deploy it in b96da58def
The hook will run git clang-format before commit, which will lint current changes before commit.

Integrated clang-format with custom config in 722d59a3e0711ec517b9045e34cd718c8c7c3490 Added a git hook and script to deploy it in b96da58deff10aaf121ad5bfc750432af5a4b0d8 The hook will run `git clang-format` before commit, which will lint current changes before commit.
Owner

After a very throughout peer review of clang-format settings with @sateallia, we have decided to change alignment options with commit 7f0a207220, it should be noted that even the slightest change in the linter configuration changes all the files in the repository. It is advised to not touch it unless absolutely necessary.

After a very throughout peer review of clang-format settings with @sateallia, we have decided to change alignment options with commit 7f0a2072208b63413ebcc0bb20a0278e579f6376, it should be noted that even the slightest change in the linter configuration changes all the files in the repository. It is advised to not touch it unless absolutely necessary.
Owner

I say this and still change things. Apparently with clang-format 15 you can format control statements to always have braces. Also added linebreak at EOF because Windows doesn't do it for you.
Related commit: 9dc6b70f19

I say this and still change things. Apparently with clang-format 15 you can format control statements to always have braces. Also added linebreak at EOF because Windows doesn't do it for you. Related commit: 9dc6b70f195d295d80bed41a6ef681d108a80d30
Author
Owner

Have you considered not using Windows?

Have you considered not using Windows?
Owner

i like working on a proper system thank you

i like working on a proper system thank you
Author
Owner

t. windows user

t. windows user
Owner

t. fartix user

t. fartix user
Author
Owner

Please see the attached image for my reaction.

Please see the attached image for my reaction.
437 KiB
Owner

how dare you use a toy OS and make me cry 😭

how dare you use a toy OS and make me cry 😭
Author
Owner

t. windows user

t. windows user
Author
Owner

4fe5676d63 breaks pedantic but is necessary for correct functionality. @FMudanyali - please make a patch that both works correctly and is pedantic-compliant.

https://git.homd.xyz/asagiri/asagiri/commit/4fe5676d63b3f4d5722c5292fc3558f9ef88c401 breaks pedantic but is necessary for correct functionality. @FMudanyali - please make a patch that both works correctly and is pedantic-compliant.
Sign in to join this conversation.
No Milestone
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: asagiri/asagiri#5
No description provided.