Showing posts with label FreeBSD. Show all posts
Showing posts with label FreeBSD. Show all posts

Friday, March 20, 2026

DRM-KMOD, checking what drm-kmod version is installed, what firmware files got loaded with dmesg

DRM-KMOD,  checking what drm-kmod version is installed, what firmware files got loaded with dmesg output

 
On FreeBSD, the active DRM kernel module is generally provided by the
drm-kmod meta-port, which installs drm-510-kmod (Linux 5.10) for FreeBSD 13/14, or drm-515-kmod / drm-61-kmod for newer versions. The specific module loaded is usually i915kms (Intel), amdgpu (AMD), or radeon.
How to check which is installed/loaded:
  • List installed DRM packages: pkg info | grep drm
  • Check currently loaded modules: kldstat | grep kms
Common DRM Module Drivers:
  • amdgpu: For AMD GPUs (HD7000 series and newer).
  • i915kms: For Intel integrated graphics (Sandy Bridge and newer).
  • radeon: For older AMD/ATI Radeon GPUs.
Commonly Used Meta-Ports:
  • graphics/drm-510-kmod (commonly used for 14.1)
  • graphics/drm-515-kmod (common on 14.2+)
  • graphics/drm-61-kmod (for latest kernels)
You can verify the active driver with sysctl dev.drm
 
root@flf_FBSD_15_STABLE:~ #  sysctl dev.drm
dev.drm.drm_debug_persist: 0
dev.drm.skip_ddb: 0
dev.drm.__drm_debug: 0
 
 
 
 
 
 
TFTP install
 

Step 2: Install the TFTP Server Software

FreeBSD provides a TFTP server implementation as part of the net/tftp-hpa package. This package includes both the TFTP server (tftpd) and client (tftp). To install it, use the pkg package manager:

sudo pkg install tftp-hpa 
root@flf_FBSD_15_STABLE:~ # sudo pkg install tftp-hpa
Updating FreeBSD-ports repository catalogue...
FreeBSD-ports repository is up to date.
Updating FreeBSD-ports-kmods repository catalogue...
FreeBSD-ports-kmods repository is up to date.
Updating FreeBSD-base repository catalogue...
FreeBSD-base repository is up to date.
All repositories are up to date.
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
tftp-hpa: 5.2_3 [FreeBSD-ports]

Number of packages to be installed: 1

41 KiB to be downloaded.

Proceed with this action? [y/N]: y
[1/1] Fetching tftp-hpa-5.2_3: 100%    41 KiB  41.7 kB/s    00:01    
Checking integrity... done (0 conflicting)
[1/1] Installing tftp-hpa-5.2_3...
[1/1] Extracting tftp-hpa-5.2_3: 100%
=====
Message from tftp-hpa-5.2_3:

--
===> NOTICE:

The tftp-hpa port currently does not have a maintainer. As a result, it is
more likely to have unresolved issues, not be up-to-date, or even be removed in
the future. To volunteer to maintain this port, please create an issue at:

https://bugs.freebsd.org/bugzilla

More information about port maintainership is available at:

https://docs.freebsd.org/en/articles/contributing/#ports-contributing
 

 

Once the installation is complete, verify that the package was installed correctly:

tftpd --version 
root@flf_FBSD_15_STABLE:~ # tftpd --version
sh: tftpd: not found
 
root@flf_FBSD_15_STABLE:~ # pkg info tftp-hpa
tftp-hpa-5.2_3
Name : tftp-hpa
Version : 5.2_3
Installed on : Thu Mar 19 23:45:08 2026 PDT
Origin : ftp/tftp-hpa
Architecture : FreeBSD:15:amd64
Prefix : /usr/local
Categories : ftp
Licenses : BSD4CLAUSE
Maintainer : ports@FreeBSD.org
WWW : UNKNOWN
Comment : Advanced TFTP server
Options :
DOCS : on
Shared Libs required:
libc.so.7
libwrap.so.6
Annotations :
FreeBSD_version: 1500068
build_timestamp: 2026-02-28T04:30:49+0000
built_by : poudriere-git-3.4.5-7-g21c69a49
port_checkout_unclean: no
port_git_hash : b64b73fd938d5b2788547d16ed6a76493acc9142
ports_top_checkout_unclean: no
ports_top_git_hash: df4f957ea181e02b372261e71f9067e9e37d7369
repo_type : binary
repository : FreeBSD-ports
Flat size : 86.6KiB
Description :
tftp-hpa is portable, BSD derived tftp server. It supports advanced
options such as blksize, blksize2, tsize, timeout, and utimeout.
It also supported rulebased security options.

Step 3: Configure the TFTP Server

The TFTP server on FreeBSD is typically managed by the inetd or xinetd super server, which handles network services. In this guide, we will use inetd, which is included in the FreeBSD base system.

3.1 Enable the inetd Service

First, enable the inetd service by editing the /etc/rc.conf file. You can do this using the sysrc command:

sudo sysrc inetd_enable="YES" 
root@flf_FBSD_15_STABLE:~ # sudo sysrc inetd_enable="YES"
inetd_enable: NO -> YES
 
 
 AUTOMATED Freebsd install https://eradman.com/posts/automated-freebsd-install.html 
root@flf_FBSD_15_STABLE:~ #  tftp-hpa --version
sh: tftp-hpa: not found
root@flf_FBSD_15_STABLE:~ # tftpd --version
sh: tftpd: not found
root@flf_FBSD_15_STABLE:~ # tftp --version
tftp: Name could not be resolved at this time
tftp>
tftp> help
Commands may be abbreviated. Commands are:

connect connect to remote tftp
mode set file transfer mode
put send file
get receive file
quit exit tftp
verbose toggle verbose mode
status show current status
binary set mode to octet
ascii set mode to netascii
rexmt set per-packet retransmission timeout[-]
timeout set total retransmission timeout
trace enable 'debug packet'[-]
debug enable verbose output
blocksize set blocksize[*]
blocksize2 set blocksize as a power of 2[**]
rollover rollover after 64K packets[**]
options enable or disable RFC2347 style options
help print help information
packetdrop artificial packetloss feature
windowsize set windowsize[*]
? print help information

[-] : You shouldn't use these ones anymore.
[*] : RFC2347 options support required.
[**] : Non-standard RFC2347 option.
tftp>
 



 
 
 

This command should display the version of the TFTP server software, confirming that the installation was successful.



 
 
 
 
 

Step 1: Update the FreeBSD System

sudo freebsd-update fetch
sudo freebsd-update install
sudo pkg update
sudo pkg upgrade

Step 2: Install the TFTP Server Software

sudo pkg install tftp-hpa
 
 

Friday, January 2, 2026

Download FreeBSD AMD64 15.0-CURRENT image from FreeBSD ISO Images directory http://freebsd.org/where

Download  FreeBSD AMD64 15.0-CURRENT image from FreeBSD ISO Images 

https://download.freebsd.org/releases/amd64/amd64/ISO-IMAGES/15.0/   Directory of 15.0 images

   # use this image file or something similar to this AMD64 image for FreeBSD operating system 

Use curl or  wget app to download image.

curl -O https://download.freebsd.org/releases/ISO-IMAGES/15.0/FreeBSD-15.0-RELEASE-amd64-mini-memstick.img.xz
or

 

ls -lh FreeBSD*
total 126M
-rw-r--r-- 1 kliktel kliktel 115M Jan  2 02:17  FreeBSD-15.0-RELEASE-amd64-mini-memstick.img.xz
 
[kliktel@kliktel-pc Downloads]$ cd FreeBSD
[kliktel@kliktel-pc FreeBSD]$ ls
 
FreeBSD-15.0-RELEASE-amd64-mini-memstick.img.xz 
                       
[kliktel@kliktel-pc FreeBSD]$ sudo unxz -c FreeBSD-15.0-RELEASE-amd64-mini-memstick.img.xz | dd of=/dev/sdb bs=1M conv=fsync status=progress
[sudo] password for kliktel:  
689295872 bytes (689 MB, 657 MiB) copied, 76 s, 9.0 MB/s  
0+17566 records in
0+17566 records out
689295872 bytes (689 MB, 657 MiB) copied, 95.0699 s, 7.3 MB/s
[kliktel@kliktel-pc FreeBSD]$

Using Manjaro Linux or FreeBSD to download with curl, write image using 'unxz' and 'dd' commands.  Use 'gdisk' to look at resulting partitions on /dev/sdb

This was tested on Manjaro Linux laptop.  

[kliktel@kliktel-pc FreeBSD]$ uname -a
Linux kliktel-pc 5.10.234-2-MANJARO #1 SMP PREEMPT Mon Feb 3 16:28:09 UTC 2025 x86_64 GNU/Linux

 
[kliktel@kliktel-pc FreeBSD]$ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 003: ID 04f2:b2db Chicony Electronics Co., Ltd Thinkpad T430 camera
Bus 001 Device 050: ID 154b:00ee PNY USB 2.0 FD
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 002: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 003 Device 005: ID 1b3f:2008 Generalplus Technology Inc. USB Audio Device
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
[kliktel@kliktel-pc FreeBSD]$ gdisk /dev/sdb
GPT fdisk (gdisk) version 1.0.10

Partition table scan:
 MBR: MBR only
 BSD: not present
 APM: not present
 GPT: not present


***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format
in memory. THIS OPERATION IS POTENTIALLY DESTRUCTIVE! Exit by
typing 'q' if you don't want to convert your MBR partitions
to GPT format!
***************************************************************

Warning! Main partition table overlaps the first partition by 33 blocks!
You will need to delete this partition or resize it in another utility.

Command (? for help): p
Disk /dev/sdb: 60628992 sectors, 28.9 GiB
Model: USB 2.0 FD       
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): F71BE7A5-2FC7-4A67-9797-AD5BA071E3C0
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 60628958
Partitions will be aligned on 1-sector boundaries
Total free space is 59282678 sectors (28.3 GiB)

Number  Start (sector)    End (sector)  Size       Code  Name
  1               1           66584   32.5 MiB    EF00  EFI system partition
  2           66585         1346280   624.9 MiB   A500  FreeBSD disklabel

Command (? for help): q
[kliktel@kliktel-pc FreeBSD]$

 Disk /dev/sdb: 28.91 GiB, 31042043904 bytes, 60628992 sectors
Disk model: USB 2.0 FD       
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x90909090

Device     Boot Start     End Sectors   Size Id Type
/dev/sdb1           1   66584   66584  32.5M ef EFI (FAT-12/16/32)
/dev/sdb2  *    66585 1346280 1279696 624.9M a5 FreeBSD
[kliktel@kliktel-pc FreeBSD]$ fdisk -l /dev/sdb
Disk /dev/sdb: 28.91 GiB, 31042043904 bytes, 60628992 sectors
Disk model: USB 2.0 FD       
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x90909090

Device     Boot Start     End Sectors   Size Id Type
/dev/sdb1           1   66584   66584  32.5M ef EFI (FAT-12/16/32)
/dev/sdb2  *    66585 1346280 1279696 624.9M a5 FreeBSD
[kliktel@kliktel-pc FreeBSD]$


Reference Grok/i  answer to download a img.xz compressed image and write into a USB flash disk drive stick in one command line:

https://x.com/i/grok/share/6jQQ22gx02jbT3IOi65HBudSH 

 

Install FreeBSD-15.0-CURRENT to an AlderLake N150 or N100 miniPC.

https://x.com/i/grok/share/fZeAQyPE0NAHer7PpK7PIldiL 

Tuesday, March 25, 2025

Setting up a FreeBSD WIFI connection for RealTek 8821CE Chipset

 Setting up a FreeBSD WIFI connection for RealTek 8821CE Chipset

To get the Realtek RTL8821CE WiFi card working on FreeBSD, you’ll need to use the rtw88 driver, which supports this chipset, along with the appropriate firmware. Below is a step-by-step guide based on the current state of FreeBSD as of March 22, 2025. Note that this process assumes you’re running FreeBSD 14.0 or later, as support for RTL8821CE has improved in recent releases.   
Freebsd.org/where Get RELEASE 14.2 or newer  Here look for an image file to write to a usb flash device disk drive stick.
 FreeBSD CLI command to see what wifi chipset device you have and network connection
pciconf -lv | grep -A4 network
 Grok  Share link below
https://x.com/i/grok/share/OTZkqixA4P1FI2lMA9j29tYzm 
 
To get the Realtek RTL8821CE WiFi card working on FreeBSD, you’ll need to use the rtw88 driver, which supports this chipset, along with the appropriate firmware. Below is a step-by-step guide based on the current state of FreeBSD as of March 22, 2025. Note that this process assumes you’re running FreeBSD 14.0 or later, as support for RTL8821CE has improved in recent releases.

1. Verify Hardware Detection
First, confirm that FreeBSD detects your RTL8821CE card. Run the following command in a terminal:
pciconf -lv | grep -A4 network
Look for an entry mentioning "Realtek" and "RTL8821CE" (device ID 0xc821). If it’s listed as a network controller but not yet functional, it’s recognized but needs the driver and firmware loaded.
2. Check for the rtw88 Driver
The rtw88 driver, which supports the RTL8821CE, is included in FreeBSD’s kernel as of version 13.1 and later. To see if it’s available, check for the kernel module:
ls /boot/kernel | grep if_rtw88.ko
If the file exists, the driver is part of your system. If not, you may need to update your FreeBSD installation to a version that includes it (e.g., 14.0 or higher).
3. Install the Firmware
The rtw88 driver requires firmware to operate the RTL8821CE. FreeBSD provides this through the wifi-firmware-rtw88-kmod package. Install it with:
sudo pkg install wifi-firmware-rtw88-kmod
This package includes firmware files like rtw88/rtw8821c_fw.bin, which is specific to the RTL8821CE chipset. After installation, the firmware files will be placed in /boot/modules.
4. Load the Driver and Firmware
Load the rtw88 driver manually to test it:
sudo kldload if_rtw88
If your system has more than 4GB of RAM (common on modern machines), you’ll also need to set a loader tunable to ensure proper memory allocation for the driver. Edit /boot/loader.conf (create it if it doesn’t exist) and add:
compat.linuxkpi.skb.mem_limit="1"
Then reboot your system to apply this change:
sudo reboot
After rebooting, the driver should autoload via devmatch (enabled by default in /etc/rc.conf). To confirm it’s loaded, run:
kldstat | grep rtw88
You should see if_rtw88.ko listed.
5. Configure the WiFi Interface
Once the driver and firmware are loaded, a WiFi interface (e.g., rtw880) should appear. Check with:
ifconfig
If you see an interface like rtw880, create a WLAN interface:
sudo ifconfig wlan0 create wlandev rtw880
Connect to your WiFi network by editing /etc/wpa_supplicant.conf with your network details:
network={
    ssid="YourNetworkName"
    psk="YourPassword"
}
Then bring up the interface:
sudo ifconfig wlan0 up
sudo wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf &
Obtain an IP address via DHCP:
sudo dhclient wlan0
6. Automate at Boot
To make this persistent, add the following to /etc/rc.conf:
wlans_rtw880="wlan0"
ifconfig_wlan0="WPA DHCP"
This ensures the interface is created and configured automatically on boot.
7. Troubleshooting
  • Driver Not Loading: If kldload if_rtw88 fails, ensure the firmware is installed and the module is present in /boot/kernel.
  • No Firmware Errors: Check dmesg for messages like "failed to load rtw88/rtw8821c_fw.bin". Reinstall the firmware package if needed.
  • Performance Issues: The rtw88 driver is still under development and may not be fully stable. If you encounter stalls or disconnects, try setting these sysctls:
    sudo sysctl compat.linuxkpi.rtw88_pci_disable_aspm=1
    sudo sysctl compat.linuxkpi.rtw88_disable_lps_deep=1
    These disable power-saving features that can cause issues.
Notes
  • The rtw88 driver supports RTL8821CE, but it’s not perfect yet. Some users report intermittent connectivity, especially on systems with more than 4GB of RAM, hence the mem_limit tunable.
  • If this doesn’t work, consider the wifibox project, which runs a Linux WiFi driver in a virtualized environment on FreeBSD. It supports RTL8821CE but requires more setup (see GitHub: pgj/freebsd-wifibox-alpine).
This should get your RTL8821CE working on FreeBSD with the right settings and firmware! Let me know if you hit any snags.