---
# System prepended metadata

title: PttBBS source code study
tags: [Templates, Documentation]

---

---
title: 'PttBBS source code study'
disqus: hackmd
---

PttBBS source code study
===
![downloads](https://img.shields.io/github/downloads/atom/atom/total.svg)
![build](https://img.shields.io/appveyor/ci/:user/:repo.svg)
![chat](https://img.shields.io/discord/:serverId.svg)

## Table of Contents

[TOC]

## How To get PttBBS Source Code

1. Web: https://github.com/ptt/pttbbs
2. git clone https://github.com/ptt/pttbbs.git

## Compile-time Dependency

1. pmake
2. gcc or clang
3. python
4. iconv library (for Big5-UTF8 conversion)
5. (NEW) flatbuffers


### pmake

1. Default in FreeBSD
2. Use (make -V VAR) to print the value of VAR variale (For debugging usage)
3. 

### gcc or clang

### python

1. Use python2 for default, but python2 is deprecated soon.
2. Trying to use python 3.8 to see whether there are any errors or not.

1. Both are OK
2. Prefer clang but don't know differences right now (What a noob I'm !! QQ)
3. Fixing compiler detection rule in pttbbs.mk 

> Read more about Gherkin here: https://docs.cucumber.io/gherkin/reference/

## Compile sequence

## Installation

1. FreeBSD 12.1-RELEASE 的 objcopy 沒有 --compress-debug-sections 選項導致 make install 失敗，先把這個選項拿掉，debug用不影響主程式 mbbsd 運作

## System internal components

### Encoding (Big5 <-> UTF-8)


### telnet (Abandoned because of plain-text transfer)

### SSH

### WebSocket

### Shared Memory

### Semaphore

### Leak Check (Valgrind)

### screen.c vs. pfterm.c

### 


User flows
---
```sequence
Alice->Bob: Hello Bob, how are you?
Note right of Bob: Bob thinks
Bob-->Alice: I am good thanks!
Note left of Alice: Alice responds
Alice->Bob: Where have you been?
```

> Read more about sequence-diagrams here: http://bramp.github.io/js-sequence-diagrams/

Project Timeline
---
```mermaid
gantt
    title A Gantt Diagram

    section Section
    A task           :a1, 2014-01-01, 30d
    Another task     :after a1  , 20d
    section Another
    Task in sec      :2014-01-12  , 12d
    anther task      : 24d
```

> Read more about mermaid here: http://mermaid-js.github.io/mermaid/

## Appendix and FAQ

:::info
**Find this document incomplete?** Leave a comment!
:::

###### tags: `Templates` `Documentation`
