2021年12月17日 星期五

C sample code for PIC micros and Hi-Tech C usb rs232

 C sample code for PIC micros and Hi-Tech C
https://www.microchipc.com/sourcecode/


C sample code for PIC micros and Hi-Tech C

Sample projects for the Microchip PIC micro series of microcontrollers, including the PIC12x, PIC16x, PIC18x, PIC24x, and dsPICx microcontrollers.

Code is targeted at the Hi-Tech C compiler, from www.htsoft.com, the C18 or C30 compiler from www.microchip.com, or CCS C.

We want to publish your embedded source code for the benefit on the PIC community. Send it to support@microchipc.comand I will post it on the site, together with recognition of your name and website.

    CRC.
    USB serial port for PIC18F4550.
    MMC card.
    Delay routines in C for PIC16Fx core.
    Delay routines in C for PIC18Fx core.
    UART for PIC16F87x and PIC18Fx.
    Bootloader - PIC16F876.
    Bootloader - PIC18F1320.
    Bootloader - PIC18Fx52.
    Bootloader - PIC17C4x.
    Bootloader - dsPIC (all variants).
    EEPROM.
    A/D.
    D/A.
    SPI.
    LCD.
    PIC12C509 logic replacement nitrogen filler.
    I2C.
    Multitasking and RTOS.
    17C4x bootloader.
    16F84 based pulse monitor.
    TRIAC controller
    Dallas DS1821 thermometer.
    Decimal routines.
    PIC16F84 pulse mon date/time RS232 serial port
    PIC16F84 TRIAC / IGBT 50/60Hz control.

    

    Phase Controller for 2kW heater.
    Dallas DS1821 three-pin digital thermostat.
    Gym Timer.
    LCD and keypad project.
    Heater Project - involves 1-wire routines, serial routines, a P.I.D (Proportional, Integral, Derivative) calculation, ADC, and a interrupt driven burst mode heater control.
    dsPIC30Fx "Hello World" example.
    dsPIC30Fx "RC Pulse" example.
    C driver code project for Samsung KS0713 and PIC micros.
    PIC18LF4550 with LCD and temperature sensor.
    MiniBasic example peripheral code in C, for PIC18, PIC24, PIC32. Examine the C source code to work out how to use any peripheral on a PIC18, PIC24 or PIC32. Very useful.
    Interrupt driven serial with circular FIFO for PIC16x micro.
    Tiny threads example - 1 byte per thread.
    The Dot Factory: An LCD Font and Image Generator
    Embedded PIC Programmer
    Portable LCD driver.
    SimpleRTOS. A tiny, portable multitasking OS.
    Improve your programming with the UVa tutorial.
    ... and much, much more.

DISKLESS PXE BOOT Kickstart で CentOS7 自動インストール - Qiita

 https://qiita.com/k-koz/items/846a0d064c51f2937b1f

@k-koz

posted at 2016-05-08

updated at 2016-05-09

Kickstart で CentOS7 自動インストール - Qiita
Kickstart で CentOS7 自動インストール
vsftpd
tftp
dhcpd
kickstart
centos7
【Kickstart で CentOS7 自動インストール】

    Kickstart 環境を構築し、CentOS7 を自動インストールする手順をまとめる


[Server: Kickstart 環境の構築]
1. TFTP server セットアップ
2. DHCP server セットアップ
3. FTP Server セットアップ    (TFTP)
4. Kickstart 設定 (CentOS7インストール用)

[Client: Kickstart 環境の利用]
1. CentOS 自動インストール実行手順

4. Kickstart 設定 (CentOS7インストール用)

f. PXE ブート設定ファイル配置ディレクトリ作成

mkdir -p /var/lib/tftpboot/pxeboot/pxelinux.cfg/

g. PXE ブート設定ファイル作成

i. kickstart ファイル作成

    オプションの詳細は RHEL7インストールマニュアル/23.3. キックスタート構文の参考資料 を参照
    パスワードは下記コマンドで生成可能

http://taeisheauton4programming.blogspot.com/2019/05/pxevirtualboxcentos-7.html

 PXEにより、VirtualBoxでCentOS 7のインストーラーを起動した(図で解説あり)
5月 01, 2019


VirtualBox Version 5.2.20 r125813 (Qt5.6.3)、CentOS Linux release 7.6.1810 (Core)を用いて、PXEによるインストーラーの起動までを試した。
PXEサーバー、PXEクライアントともに、VirtualBoxの仮想マシン。
作業開始時点のPXEサーバーの状態は、Minimal ISOをインストールした直後とする。
SELinuxはEnforcing、firewalldはstopしないで必要なだけ開放した。
基本的に、Redhatの公式ドキュメントのやり方を踏襲した。

PXEについて
PXEは、ネットワークブートを実現する仕組み。
OSやインストーラーを、ネットワーク経由で起動できる。
Kickstartと組み合わせることで、Linux OSのインストールを自動化できる。

PXEに必要なサーバーは、下記の3つ。

    DHCPサーバー - IPアドレス付与、TFTPサーバーとブートローダーの場所を教える
    TFTPサーバー - ブートローダーを提供、インストールソースの場所を教える
    ファイルサーバー(HTTP、FTP、NFSなど) - インストールソースを提供



Diskless Windows 10 PC Setup Procedure

 https://audiophilestyle.com/forums/topic/26705-diskless-windows-10-pc-setup-procedure/

 

https://audiophilestyle.com/forums/topic/26705-diskless-windows-10-pc-setup-procedure/
 Diskless Windows 10 PC Setup Procedure By scan80269,

Gigabit Ethernet NIC with PXE boot support

Gigabit Ethernet NIC, with driver for Windows Server  

DHCP server static IPs

Contents of iscsi.ipxe (text) file: #!ipxe

sanboot iscsi:<server IP>::::iqn.1991-05.com.microsoft:<server name>-win10-target boot

Share iSCSIVirtualDisks folder with rear/write permission for client username

Create TFTProot folder

Put ipxe-undionly.kpxe and iscsi.ipxe files in C:\TFTProot

Download and set up Tiny PXE Server (Tiny PXE Server - reboot.pro)

Enable iSCSI Service


Client Connect network via gigabit Ethernet NIC and cable

Attach local storage (HDD/SSD)

Install Windows 10 OS into hard disk

- Copy OS install files into FAT32 formatted USB flash drive to use for OS installation

Install NIC driver and other device drivers (graphics, audio, etc.) as needed

Ensure client can properly browse on Internet

 Launch iSCSI Initiator

- Type "iscsicpl" <Enter> at the Command Prompt window and answer Yes to the prompt

- This will configure Win10 to auto launch the iSCSI initiator service at OS startup

Launch Registry Editor (regedit.exe) to set boot flag for LAN driver

Locate the LAN driver service name under HKLM\SYSTEM\CurrentControlSet\Services

Example: for motherboards featuring Intel I217V/LM, I218V/LM, I219V/LM LAN the driver service name is: e1dexpress

Click on the driver service name, locate the Start key (REG_DWORD), double-click it and change its value to 0

- Repeat this Start key value change to 0 in HKLM\SYSTEM\ControlSet001\Services and HKLM\SYSTEM\ControlSet002\Services

Close Registry Editor

Download and run Disk2VHD.exe (from Microsoft Sysinternals: https://technet.microsoft.com/en-us/sysinternals/ee656415.aspx)

- Ensure "Use Vhdx" and "Use Volume Shadow Copy" checkboxes are checked

- In "VHD File Name" box, enter "\\<Server IP>\<share name>\Win10.VHDX (e.g. \\192.168.0.100\c\Win10.VHDX)

- Run Disk2VHD to create VHDX file on server

 
Server:

Set up iSCSI target LUN

Use "existing VHDX"

Add MAC address of client to iSCSI initiator list

 

 

Client:

 Launch "iSCSI Initiator"

 On "Discovery" tab, click "Discover Portal" and enter IP address or DNS name of server

 on "Targets" tab, ensure a target appears on "Discovered targets" list

 target name should look like: iqn.1991-05.com.microsoft:<server name>-Win10-target

 Shut down Windows and detach hard disk from client

 Power up client and it should proceed to PXE boot

- PXE boots to iPXE from server, then chains to iSCSI target LUN to start Windows 10 boot

 

 

 

Notes:

A. This procedure sets up a fixed size VHDX on the server. An alternative is to create a new dynamic VHDX (of desired max size) on the server, mount it locally (using iSCSI Initiator running on the server), connect the client disk to the server via USB-to-SATA adapter, then partition copy the client disk to the mounted VHDX. This preserves the dynamic nature of the VHDX file and helps conserve disk space on the server.