Mahdi
Have you looked at the logs? Maybe the problem is something simple?
Sadra
Mahdi
Mahdi
Mahdi
I am seriously and carefully studying the FreeBSD handbooks.
Sadra
nami
harmony5 🇺🇳 ⌤
What DE and theme?Is that xfce?
Mahdi
accelerat0r 🇮🇱 🇮🇱 🇮🇱
What is really a destop lol?
accelerat0r 🇮🇱 🇮🇱 🇮🇱
Thats so vague to me
Pouria
.
https://www.youtube.com/watch?v=EpiiT_mgYAw
nami
nami
Anyone using bbr module?
Pouria
Could you give me your coredump or anything under your /var/crash?
Pouria
2. Did you do something or it just happened?
3. freebsd-version -kru? (and if you're on the CURRENT or STABLE, you can give me your specific kernel version (commit hash) via uname -a)
nami
Pouria
Also If it's possible, please make sure you send me the /var/crash through PM or email, NOT in this public group. It may contain some confidential information.
bittin-
https://hackerpublicradio.org/eps/hpr4388/index.html HPR today about BSD
bittin-
https://www.bjoremanmelin.se/podcast/avsnitt-443-valkommen-till-bsd.html
Mahdi
Hi dear friend,
I hope you're doing well.
Sorry if my question isn't very professional, but your answer could really help me a lot.
I'm currently studying the FreeBSD source code and right now I'm reading loader/main.c.
My biggest problem is when the project gets large and I get lost in the source code.
Is there any book that teaches the correct way to read a programming project and helps understand its structure?
This file, for example, has 2017 lines of code, and I can't understand all of it — and soon I forget what each function was made for.
I'd be really happy if you could recommend a book or blog that helps with this problem and teaches how to properly read source code
Maxim
Mahdi
Are you trying to fit the whole os in your head?
😂 What exactly should I do?👀 Should I write it down on paper?
The biggest project I’ve ever read and analyzed was about 300 lines of code.
Yet, even when I looked back at the early parts of my project, some functions still seemed unfamiliar to me.😂
Mahdi
maybe I am forgetful? 🥺
Maxim
No, the point is, the project is too big to fit in one head
Mahdi
Mahdi
Mahdi
I've heard things about personal documentation, but I don't know how it helps or how to do it.
Mahdi
Maxim
harmony5 🇺🇳 ⌤
harmony5 🇺🇳 ⌤
Abhi
harmony5 🇺🇳 ⌤
Abhi
Which wifi tui manager you guys use
SludgyWitch
OSes are a big project that do not fit inside one single developer's head
it always resides in a common repository and all developers should have a basic / general idea of what the OS does where (address / momery allocation, drivers etc) and they usually focus on their respective parts
Mahdi
Mahdi
harmony5 🇺🇳 ⌤
Mahdi
Hi dear Freidns
Mahdi
Greetings, friends! This question might seem a bit unprofessional, and perhaps it's not even appropriate to ask, but the nature of a question is to inquire—so I hope you won’t mind the length of this message.
Friends, I ran a simple source code on FreeBSD to test FreeBSD’s memory allocation behavior, and I encountered an interesting issue. It’s not a bug—perhaps this is how it is supposed to work.
I executed the following code, which manually accesses two byte of memory, assigns a value to it, and then reads the value stored in that byte. Source code: (Note: I do not want to use system calls like malloc, because in that case, there would be no issue.)
#include <stdio.h>
int main ()
{
// char *a;
// char b=0;
// a=&b;
// printf ("%p\n", (void*)a); // to know memory available range in Protected Mode OS
volatile char *p = (char*)0x7ffcfbd5191f;
*p = 'H';
printf ("%p\n", (void*)p);
printf ("%c\n", *p);
return 0;
}
In each execution, the memory allocation system in protected mode should create a new range for the program’s segments. (I am not sure why, but perhaps it is for security reasons.) This is also the case in FreeBSD, and you can observe it by the continuously changing and discrete nature of variable addresses.
Now, when a new range is allocated for a process's segments, that process should not be allowed to access other memory addresses, correct?
This issue does not occur in Linux—when the above code is executed, the software is immediately aborted. However, FreeBSD behaves differently—sometimes it produces an output, and sometimes no output is printed at all.
So, why does it sometimes produce output? Is it because the software segment range overlaps with the memory byte address? And why does it sometimes produce no output? Is it because the software segment range does not overlap with the memory byte address, and instead of FreeBSD killing the program, it simply returns nothing?
My exact question is this: Since I manually accessed memory and did not use system calls like malloc—which means the memory allocation system did not interfere—why does Linux abort the software upon first execution, whereas FreeBSD either displays the output or sometimes does not?
Was I able to articulate my question clearly?
Mahdi
Does the operating system still free memory for us when we manually read a portion of it? Isn't this behavior only expected when using malloc?
Is this related to the operating system's protected mode?
Lirili
the address you accessed is virtual memory space of a process
Lirili
maybe that address has special propose, maybe not, I don't care.
Lirili
All in all, you should not do what you are doing. If you don't like malloc of std lib, you can write an allocator youself.
Lirili
https://github.com/microsoft/mimalloc
Mahdi
first, i create a standard variable and look at the Address of that
and put it on the source code
Mahdi
Mahdi
Mahdi
So when I manually read a byte from memory, does the operating system actually provide it?
Lirili
It is belong to virtual memory space of a process
Lirili
https://pages.cs.wisc.edu/~remzi/OSTEP/
Pouria
Mahdi
Mahdi
thanks for your helps
❤️👀
Pouria
OSTEP is awesome.
However, I also suggest cs631 for c in unix environment
https://youtube.com/playlist?list=PL0qfF8MrJ-jxMfirAdxDs9zIiBg2Wug0z&si=YPPZO-2zhcRvVQBK
Mahdi
I read the Minix3 book by Tanenbaum, but every book about computers has limitations
Mahdi
🙏🏻
Pouria
Pouria
If you want to know specific behavior about FreeBSD. Try the design and implementation of FreeBSD OS book from mckusick
Pouria
We are discussing the panic in the transport meeting, it happened to the sctp stack before.
BUT, without further information. we couldn't help much.
@namiarj
Pouria
https://wiki.freebsd.org/TransportProtocols/29May2025
The report about your panic (@namiarj):
The following panic (https://ibb.co/tTVgbtqt) was observed. Pouria is asking for more information.
nami