SlideShare une entreprise Scribd logo
1  sur  30
Uclinux on the Pluto 6
From this....
To this...
Edwin Langley : Heber
edwin@heber.co.uk
Craig Duffy : University of the West of
England
Craig.Duffy@uwe.ac.uk
Project Origin
Pluto 6 Fruit machine controller board
made by Heber:
● Heber have developed their own in-
house monitor/executive
– It has drivers written from scratch by
Heber
– It is fast, and well understood
– We provide to customers drivers compiled
to Library object files
● However there is a problem...
– Future boards may use more complex
peripheral buses
– We will require more complex software
● E.G. TCP/IP stack, USB hosting
Project Origin
● A version of the Linux kernel for
microcontrollers without a MMU
● First port in January 1998 by Rt-Control
● Differences to Linux - uClinux has:
– No virtual address spaces; applications must
be linked to absolute addresses
– No memory protection
– To have drivers altered to operate through
local bus instead of ISA/PCI, with bigger
interrupt vector ranges
Background to uClinux
● Create development environment
– Obtain tool chain
– m68k-elf-gdb
● Create new board configuration
● Edit entry assembly in crt0_ram.S
– Set variables _rambase, _ramstart, _ramend,
_ramvec.
● Edit linker script in ram.ld
– Link to DRAM at 0x60000000
Porting uClinux to the Pluto 6
● Crashed in kernel during boot:
– Assembly variables were wrong
● #define MEM_SIZE 0x0016fefc
– PAGE_OFFSET was wrong
– Stack corruption
● Set SP to end of external SRAM
– MBAR wrongly set to address of SRAM
● #define MCF_MBAR 0x10000000
Porting uClinux to the Pluto 6
– Romfs too big
● _ramstart
calculated >
_ramend
Porting uClinux to the Pluto 6
RAM
.text
.data
.romfs
0x60000000 _stext
_sdata
_sbss
_ebss
Dynamic
memory
0x6016FEFC
A0
A1
A0 + ROMFS size
A1 + ROMFS size
Copy data
from end
forwards
– VBR set to start of RAM, overwriting kernel
– Set _ramvec to ColdFire internal SRAM
● Finally a working kernel!
– But...
● 2Mb of DRAM doesn't give even uClinux
much room to do anything
– After 3 commands, memory is too
fragmented to load programs:
Porting uClinux to the Pluto 6
– Romfs contents restricted
– Tools are required to test drivers
/bin> vi
__alloc_pages: 0-order allocation failed (gfp=0x1d2/0)
__alloc_pages: 4-order allocation failed (gfp=0x1f0/0)
Allocation of length 65000 from process 20 failed
Free pages: 136kB ( 0kB HighMem)
Zone:DMA freepages: 0kB
Zone:Normal freepages: 136kB
Zone:HighMem freepages: 0kB
( Active: 5, inactive: 27, free: 34 )
= 0kB)
6*4kB 2*8kB 2*16kB 0*32kB 1*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB = 136kB)
= 0kB)
Running the kernel from VRAM
● Problem: program counter incrementing incorrectly
● Possibly cache related
● Initial solution to use video card RAM
● Solution found and borrowed from Heber:
Getting more memory
● Finally a working USABLE kernel!
FPGA for DRAM
to local bus
decoding
DRAM
Battery
16Mb local
bus interface
DRAM card
● Vacuum Fluorescent Display
– Simple character device
– Clock ASCII characters in through 2 line serial
port
Time to write some drivers!
/> echo hello world! > /dev/vfd0
● FPGA controls 256 lamps as 16 strobes of
32, each has 8 brightness levels
● Every 1ms, software must:
– fill 8 32 bit data registers, each bit
corresponds to one lamp
– Write the strobe number to illuminate to the
MPX control register in the FPGA
● The FPGA splits the 1ms period into 8
segments, using 1 data register for each
● Each bit of each data register = 1/8ms
Multiplexed lamp driver
● Problem:
– Kernel timer used to rewrite lamp registers
every millisecond
– Interrupt set for next jiffy, which is
incremented by timer interrupt
– Timer interrupt frequency determined by HZ
– HZ default is 100 (every 10ms)
– Lamps flash (on for 1ms, off for 9ms)
– Increased HZ to 1000
Multiplexed lamp driver
● Choosing interface to user space
– Write a char for brightness of each lamp
● 1 file for all 256 lamps
– Big overhead to change 1 lamp
● 1 file for each lamp
– 256*3*2=1536 context switches
● Best compromise
– 1 file for each lamp strobe
Multiplexed lamp driver
Multiplexed lamp driver
/> echo 0123456776543210 > /dev/lamps10
/> echo 0707070707070707 > /dev/lamps15
Frame buffer driver
● Graphics were a key part of project
● Two options
– Port a Denx Coral P X server on a PPC board
accessed through PCI running full Linux
– Write a frame buffer driver from scratch
Cremson video
controller
DRAM
Fujitsu Calypso 32 Graphics card
Frame buffer driver
● Not a lot of design
required
● But understanding
of sub system is
required
● Values written to
Cremson stored in
a par structure
– Initial par instance
with set values
used for testing
● 1024x768x16
fb_info
fb_var_screeninfo
fb_fix_screeninfo
fb_monospecs
fb_ops * fb_ops
fbgen_get_fix()
fbgen_get_var()
fbgen_set_var()
fbgen_get_cmap()
fbgen_set_cmap()
fbgen_pan_display()fb_cmap
display * display
Par *
cremsonfb_info
fb_info_gen
fbgen_hwswitch * cremsonfb_switch
cremson_detect()
cremson_encode_fix()
cremson_decode_var()
cremson_encode_var()
cremson_get_par()
cremson_set_par()
cremson_get_getcolreg()
cremson_set_getcolreg()
cremson_pan_display()
cremson_blank()
cremson_set_disp()
uint32_t fbcon_cmap[256]
void *screen_base_phys
void *screen_base_virt
uint32_t vid_mem_len
par
Cremson register
copies
unsigned int parsize
Frame buffer driver
● Lots of code mistakes before finally:
Frame buffer driver
● Endian issue, added byte swaps to macros
in fb_con.h:
Frame buffer driver
● Forgot to allocate memory to 16 entry
console pseudo palette:
Frame buffer driver
● Had a try with 8 bit indirect colour mode
● Created a new par instance
Frame buffer driver
● Set bit field lengths in fb_var_screeninfo to 8:
Frame buffer driver
● Set layer width in Cremson correctly:
Frame buffer driver
● Finally, set the palette tables in video
memory in cremson_setcolreg():
Nano X
● A pain to compile
IDE
● Used a generic driver provided by uClinux
● FPGA outputs same interrupt level for
CompactFlash and Cremson
● Lots of trouble with Cremson Vsync interrupt
while unmasking in ColdFire for the IDE
– Mask Vsync on Cremson
– Unmask interrupt vector on ColdFire
● Copied romfs to CompactFlash card
● Altered kernel command line to mount as
root FS
eXecute In Place
● Tried XIP with romfs
– Romfs scrambled when copying .data and .init
from ROM area to RAM area
– No need for romfs with a working disk present
● Added initial vector table to crt0_rom.S
● Split DRAM card into 2 Mb "ROM" and the
rest as RAM area
● Could finally boot straight into uClinux at
power on
MEMORY {
flash : ORIGIN = 0x00000000, LENGTH = 0x00200000
ram : ORIGIN = 0x00200000, LENGTH = 0x00E00000
}
● Project was successful
● Verdict
– Board is rather slow
– Accumulated knowledge for future Heber
boards
● Lessons learned
– Understand code before starting
● learned lesson porting
● used lesson on frame buffer
– Learned lots about kernel programming
Conclusion
Questions

Contenu connexe

Tendances

eBPF in the view of a storage developer
eBPF in the view of a storage developereBPF in the view of a storage developer
eBPF in the view of a storage developerRichárd Kovács
 
Current and Future of Non-Volatile Memory on Linux
Current and Future of Non-Volatile Memory on LinuxCurrent and Future of Non-Volatile Memory on Linux
Current and Future of Non-Volatile Memory on Linuxmountpoint.io
 
Vanquishing Latency Outliers in the Lightbits LightOS Software Defined Storag...
Vanquishing Latency Outliers in the Lightbits LightOS Software Defined Storag...Vanquishing Latency Outliers in the Lightbits LightOS Software Defined Storag...
Vanquishing Latency Outliers in the Lightbits LightOS Software Defined Storag...ScyllaDB
 
Task migration using CRIU
Task migration using CRIUTask migration using CRIU
Task migration using CRIURohit Jnagal
 
Linux rt in financial markets
Linux rt in financial marketsLinux rt in financial markets
Linux rt in financial marketsAdrien Mahieux
 
Kernel Recipes 2016 - kernelci.org: 1.5 million kernel boots (and counting)
Kernel Recipes 2016 - kernelci.org: 1.5 million kernel boots (and counting)Kernel Recipes 2016 - kernelci.org: 1.5 million kernel boots (and counting)
Kernel Recipes 2016 - kernelci.org: 1.5 million kernel boots (and counting)Anne Nicolas
 
Kernel Recipes 2016 - Speeding up development by setting up a kernel build farm
Kernel Recipes 2016 - Speeding up development by setting up a kernel build farmKernel Recipes 2016 - Speeding up development by setting up a kernel build farm
Kernel Recipes 2016 - Speeding up development by setting up a kernel build farmAnne Nicolas
 
Kernel Recipes 2017 - What's new in the world of storage for Linux - Jens Axboe
Kernel Recipes 2017 - What's new in the world of storage for Linux - Jens AxboeKernel Recipes 2017 - What's new in the world of storage for Linux - Jens Axboe
Kernel Recipes 2017 - What's new in the world of storage for Linux - Jens AxboeAnne Nicolas
 
Revisão: Forwarding Metamorphosis: Fast Programmable Match-Action Processing ...
Revisão: Forwarding Metamorphosis: Fast Programmable Match-Action Processing ...Revisão: Forwarding Metamorphosis: Fast Programmable Match-Action Processing ...
Revisão: Forwarding Metamorphosis: Fast Programmable Match-Action Processing ...Bruno Castelucci
 
Getting Started with Performance Co-Pilot
Getting Started with Performance Co-PilotGetting Started with Performance Co-Pilot
Getting Started with Performance Co-PilotPaul V. Novarese
 
Linux kernel memory allocators
Linux kernel memory allocatorsLinux kernel memory allocators
Linux kernel memory allocatorsHao-Ran Liu
 
Unix and Linux Common Boot Disk Disaster Recovery Tools by Dusan Baljevic
Unix and Linux Common Boot Disk Disaster Recovery Tools by Dusan BaljevicUnix and Linux Common Boot Disk Disaster Recovery Tools by Dusan Baljevic
Unix and Linux Common Boot Disk Disaster Recovery Tools by Dusan BaljevicCircling Cycle
 
BKK16-317 How to generate power models for EAS and IPA
BKK16-317 How to generate power models for EAS and IPABKK16-317 How to generate power models for EAS and IPA
BKK16-317 How to generate power models for EAS and IPALinaro
 
Threading Successes 06 Allegorithmic
Threading Successes 06   AllegorithmicThreading Successes 06   Allegorithmic
Threading Successes 06 Allegorithmicguest40fc7cd
 
Term Project Presentation (4)
Term Project Presentation (4)Term Project Presentation (4)
Term Project Presentation (4)Louis Loizides PE
 
BKK16-208 EAS
BKK16-208 EASBKK16-208 EAS
BKK16-208 EASLinaro
 
DB Latency Using DRAM + PMem in App Direct & Memory Modes
DB Latency Using DRAM + PMem in App Direct & Memory ModesDB Latency Using DRAM + PMem in App Direct & Memory Modes
DB Latency Using DRAM + PMem in App Direct & Memory ModesScyllaDB
 

Tendances (20)

eBPF in the view of a storage developer
eBPF in the view of a storage developereBPF in the view of a storage developer
eBPF in the view of a storage developer
 
Current and Future of Non-Volatile Memory on Linux
Current and Future of Non-Volatile Memory on LinuxCurrent and Future of Non-Volatile Memory on Linux
Current and Future of Non-Volatile Memory on Linux
 
Vanquishing Latency Outliers in the Lightbits LightOS Software Defined Storag...
Vanquishing Latency Outliers in the Lightbits LightOS Software Defined Storag...Vanquishing Latency Outliers in the Lightbits LightOS Software Defined Storag...
Vanquishing Latency Outliers in the Lightbits LightOS Software Defined Storag...
 
Task migration using CRIU
Task migration using CRIUTask migration using CRIU
Task migration using CRIU
 
Linux rt in financial markets
Linux rt in financial marketsLinux rt in financial markets
Linux rt in financial markets
 
Kernel Recipes 2016 - kernelci.org: 1.5 million kernel boots (and counting)
Kernel Recipes 2016 - kernelci.org: 1.5 million kernel boots (and counting)Kernel Recipes 2016 - kernelci.org: 1.5 million kernel boots (and counting)
Kernel Recipes 2016 - kernelci.org: 1.5 million kernel boots (and counting)
 
Kernel Recipes 2016 - Speeding up development by setting up a kernel build farm
Kernel Recipes 2016 - Speeding up development by setting up a kernel build farmKernel Recipes 2016 - Speeding up development by setting up a kernel build farm
Kernel Recipes 2016 - Speeding up development by setting up a kernel build farm
 
Memory management
Memory managementMemory management
Memory management
 
Kernel Recipes 2017 - What's new in the world of storage for Linux - Jens Axboe
Kernel Recipes 2017 - What's new in the world of storage for Linux - Jens AxboeKernel Recipes 2017 - What's new in the world of storage for Linux - Jens Axboe
Kernel Recipes 2017 - What's new in the world of storage for Linux - Jens Axboe
 
Lect18
Lect18Lect18
Lect18
 
Revisão: Forwarding Metamorphosis: Fast Programmable Match-Action Processing ...
Revisão: Forwarding Metamorphosis: Fast Programmable Match-Action Processing ...Revisão: Forwarding Metamorphosis: Fast Programmable Match-Action Processing ...
Revisão: Forwarding Metamorphosis: Fast Programmable Match-Action Processing ...
 
Getting Started with Performance Co-Pilot
Getting Started with Performance Co-PilotGetting Started with Performance Co-Pilot
Getting Started with Performance Co-Pilot
 
Linux kernel memory allocators
Linux kernel memory allocatorsLinux kernel memory allocators
Linux kernel memory allocators
 
Unix and Linux Common Boot Disk Disaster Recovery Tools by Dusan Baljevic
Unix and Linux Common Boot Disk Disaster Recovery Tools by Dusan BaljevicUnix and Linux Common Boot Disk Disaster Recovery Tools by Dusan Baljevic
Unix and Linux Common Boot Disk Disaster Recovery Tools by Dusan Baljevic
 
BKK16-317 How to generate power models for EAS and IPA
BKK16-317 How to generate power models for EAS and IPABKK16-317 How to generate power models for EAS and IPA
BKK16-317 How to generate power models for EAS and IPA
 
Threading Successes 06 Allegorithmic
Threading Successes 06   AllegorithmicThreading Successes 06   Allegorithmic
Threading Successes 06 Allegorithmic
 
Term Project Presentation (4)
Term Project Presentation (4)Term Project Presentation (4)
Term Project Presentation (4)
 
Xen Debugging
Xen DebuggingXen Debugging
Xen Debugging
 
BKK16-208 EAS
BKK16-208 EASBKK16-208 EAS
BKK16-208 EAS
 
DB Latency Using DRAM + PMem in App Direct & Memory Modes
DB Latency Using DRAM + PMem in App Direct & Memory ModesDB Latency Using DRAM + PMem in App Direct & Memory Modes
DB Latency Using DRAM + PMem in App Direct & Memory Modes
 

Similaire à UKUUG presentation about µCLinux on Pluto 6

Rendering Battlefield 4 with Mantle by Johan Andersson - AMD at GDC14
Rendering Battlefield 4 with Mantle by Johan Andersson - AMD at GDC14Rendering Battlefield 4 with Mantle by Johan Andersson - AMD at GDC14
Rendering Battlefield 4 with Mantle by Johan Andersson - AMD at GDC14AMD Developer Central
 
Kvm performance optimization for ubuntu
Kvm performance optimization for ubuntuKvm performance optimization for ubuntu
Kvm performance optimization for ubuntuSim Janghoon
 
SoC Idling for unconf COSCUP 2016
SoC Idling for unconf COSCUP 2016SoC Idling for unconf COSCUP 2016
SoC Idling for unconf COSCUP 2016Koan-Sin Tan
 
Linux Kernel Platform Development: Challenges and Insights
 Linux Kernel Platform Development: Challenges and Insights Linux Kernel Platform Development: Challenges and Insights
Linux Kernel Platform Development: Challenges and InsightsGlobalLogic Ukraine
 
High Performance Computer Architecture
High Performance Computer ArchitectureHigh Performance Computer Architecture
High Performance Computer ArchitectureSubhasis Dash
 
Presentation sun stor edge 9990 system technical
Presentation   sun stor edge 9990 system technicalPresentation   sun stor edge 9990 system technical
Presentation sun stor edge 9990 system technicalxKinAnx
 
AMP Kynetics - ELC 2018 Portland
AMP  Kynetics - ELC 2018 PortlandAMP  Kynetics - ELC 2018 Portland
AMP Kynetics - ELC 2018 PortlandKynetics
 
Asymmetric Multiprocessing - Kynetics ELC 2018 portland
Asymmetric Multiprocessing - Kynetics ELC 2018 portlandAsymmetric Multiprocessing - Kynetics ELC 2018 portland
Asymmetric Multiprocessing - Kynetics ELC 2018 portlandNicola La Gloria
 
Advanced performance troubleshooting using esxtop
Advanced performance troubleshooting using esxtopAdvanced performance troubleshooting using esxtop
Advanced performance troubleshooting using esxtopAlan Renouf
 
Rendering Battlefield 4 with Mantle by Yuriy ODonnell
Rendering Battlefield 4 with Mantle by Yuriy ODonnellRendering Battlefield 4 with Mantle by Yuriy ODonnell
Rendering Battlefield 4 with Mantle by Yuriy ODonnellAMD Developer Central
 
Jaime Peñalba - Kernel exploitation. ¿El octavo arte? [rooted2019]
Jaime Peñalba - Kernel exploitation. ¿El octavo arte? [rooted2019]Jaime Peñalba - Kernel exploitation. ¿El octavo arte? [rooted2019]
Jaime Peñalba - Kernel exploitation. ¿El octavo arte? [rooted2019]RootedCON
 
DB2 for z/OS - Starter's guide to memory monitoring and control
DB2 for z/OS - Starter's guide to memory monitoring and controlDB2 for z/OS - Starter's guide to memory monitoring and control
DB2 for z/OS - Starter's guide to memory monitoring and controlFlorence Dubois
 
lecture11_GPUArchCUDA01.pptx
lecture11_GPUArchCUDA01.pptxlecture11_GPUArchCUDA01.pptx
lecture11_GPUArchCUDA01.pptxssuser413a98
 
Optimizing Servers for High-Throughput and Low-Latency at Dropbox
Optimizing Servers for High-Throughput and Low-Latency at DropboxOptimizing Servers for High-Throughput and Low-Latency at Dropbox
Optimizing Servers for High-Throughput and Low-Latency at DropboxScyllaDB
 
HKG15-409: ARM Hibernation enablement on SoCs - a case study
HKG15-409: ARM Hibernation enablement on SoCs - a case studyHKG15-409: ARM Hibernation enablement on SoCs - a case study
HKG15-409: ARM Hibernation enablement on SoCs - a case studyLinaro
 
"Making Computer Vision Software Run Fast on Your Embedded Platform," a Prese...
"Making Computer Vision Software Run Fast on Your Embedded Platform," a Prese..."Making Computer Vision Software Run Fast on Your Embedded Platform," a Prese...
"Making Computer Vision Software Run Fast on Your Embedded Platform," a Prese...Edge AI and Vision Alliance
 

Similaire à UKUUG presentation about µCLinux on Pluto 6 (20)

module4.ppt
module4.pptmodule4.ppt
module4.ppt
 
Rendering Battlefield 4 with Mantle by Johan Andersson - AMD at GDC14
Rendering Battlefield 4 with Mantle by Johan Andersson - AMD at GDC14Rendering Battlefield 4 with Mantle by Johan Andersson - AMD at GDC14
Rendering Battlefield 4 with Mantle by Johan Andersson - AMD at GDC14
 
Rendering Battlefield 4 with Mantle
Rendering Battlefield 4 with MantleRendering Battlefield 4 with Mantle
Rendering Battlefield 4 with Mantle
 
Kvm performance optimization for ubuntu
Kvm performance optimization for ubuntuKvm performance optimization for ubuntu
Kvm performance optimization for ubuntu
 
SoC Idling for unconf COSCUP 2016
SoC Idling for unconf COSCUP 2016SoC Idling for unconf COSCUP 2016
SoC Idling for unconf COSCUP 2016
 
Linux Kernel Platform Development: Challenges and Insights
 Linux Kernel Platform Development: Challenges and Insights Linux Kernel Platform Development: Challenges and Insights
Linux Kernel Platform Development: Challenges and Insights
 
High Performance Computer Architecture
High Performance Computer ArchitectureHigh Performance Computer Architecture
High Performance Computer Architecture
 
Presentation sun stor edge 9990 system technical
Presentation   sun stor edge 9990 system technicalPresentation   sun stor edge 9990 system technical
Presentation sun stor edge 9990 system technical
 
AMP Kynetics - ELC 2018 Portland
AMP  Kynetics - ELC 2018 PortlandAMP  Kynetics - ELC 2018 Portland
AMP Kynetics - ELC 2018 Portland
 
Asymmetric Multiprocessing - Kynetics ELC 2018 portland
Asymmetric Multiprocessing - Kynetics ELC 2018 portlandAsymmetric Multiprocessing - Kynetics ELC 2018 portland
Asymmetric Multiprocessing - Kynetics ELC 2018 portland
 
Advanced performance troubleshooting using esxtop
Advanced performance troubleshooting using esxtopAdvanced performance troubleshooting using esxtop
Advanced performance troubleshooting using esxtop
 
Rendering Battlefield 4 with Mantle by Yuriy ODonnell
Rendering Battlefield 4 with Mantle by Yuriy ODonnellRendering Battlefield 4 with Mantle by Yuriy ODonnell
Rendering Battlefield 4 with Mantle by Yuriy ODonnell
 
Jaime Peñalba - Kernel exploitation. ¿El octavo arte? [rooted2019]
Jaime Peñalba - Kernel exploitation. ¿El octavo arte? [rooted2019]Jaime Peñalba - Kernel exploitation. ¿El octavo arte? [rooted2019]
Jaime Peñalba - Kernel exploitation. ¿El octavo arte? [rooted2019]
 
DB2 for z/OS - Starter's guide to memory monitoring and control
DB2 for z/OS - Starter's guide to memory monitoring and controlDB2 for z/OS - Starter's guide to memory monitoring and control
DB2 for z/OS - Starter's guide to memory monitoring and control
 
Linux based Stubdomains
Linux based StubdomainsLinux based Stubdomains
Linux based Stubdomains
 
100Gbps OpenStack For Providing High-Performance NFV
100Gbps OpenStack For Providing High-Performance NFV100Gbps OpenStack For Providing High-Performance NFV
100Gbps OpenStack For Providing High-Performance NFV
 
lecture11_GPUArchCUDA01.pptx
lecture11_GPUArchCUDA01.pptxlecture11_GPUArchCUDA01.pptx
lecture11_GPUArchCUDA01.pptx
 
Optimizing Servers for High-Throughput and Low-Latency at Dropbox
Optimizing Servers for High-Throughput and Low-Latency at DropboxOptimizing Servers for High-Throughput and Low-Latency at Dropbox
Optimizing Servers for High-Throughput and Low-Latency at Dropbox
 
HKG15-409: ARM Hibernation enablement on SoCs - a case study
HKG15-409: ARM Hibernation enablement on SoCs - a case studyHKG15-409: ARM Hibernation enablement on SoCs - a case study
HKG15-409: ARM Hibernation enablement on SoCs - a case study
 
"Making Computer Vision Software Run Fast on Your Embedded Platform," a Prese...
"Making Computer Vision Software Run Fast on Your Embedded Platform," a Prese..."Making Computer Vision Software Run Fast on Your Embedded Platform," a Prese...
"Making Computer Vision Software Run Fast on Your Embedded Platform," a Prese...
 

Dernier

Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 

Dernier (20)

Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 

UKUUG presentation about µCLinux on Pluto 6

  • 1. Uclinux on the Pluto 6 From this.... To this...
  • 2. Edwin Langley : Heber edwin@heber.co.uk Craig Duffy : University of the West of England Craig.Duffy@uwe.ac.uk
  • 3. Project Origin Pluto 6 Fruit machine controller board made by Heber:
  • 4. ● Heber have developed their own in- house monitor/executive – It has drivers written from scratch by Heber – It is fast, and well understood – We provide to customers drivers compiled to Library object files ● However there is a problem... – Future boards may use more complex peripheral buses – We will require more complex software ● E.G. TCP/IP stack, USB hosting Project Origin
  • 5. ● A version of the Linux kernel for microcontrollers without a MMU ● First port in January 1998 by Rt-Control ● Differences to Linux - uClinux has: – No virtual address spaces; applications must be linked to absolute addresses – No memory protection – To have drivers altered to operate through local bus instead of ISA/PCI, with bigger interrupt vector ranges Background to uClinux
  • 6. ● Create development environment – Obtain tool chain – m68k-elf-gdb ● Create new board configuration ● Edit entry assembly in crt0_ram.S – Set variables _rambase, _ramstart, _ramend, _ramvec. ● Edit linker script in ram.ld – Link to DRAM at 0x60000000 Porting uClinux to the Pluto 6
  • 7. ● Crashed in kernel during boot: – Assembly variables were wrong ● #define MEM_SIZE 0x0016fefc – PAGE_OFFSET was wrong – Stack corruption ● Set SP to end of external SRAM – MBAR wrongly set to address of SRAM ● #define MCF_MBAR 0x10000000 Porting uClinux to the Pluto 6
  • 8. – Romfs too big ● _ramstart calculated > _ramend Porting uClinux to the Pluto 6 RAM .text .data .romfs 0x60000000 _stext _sdata _sbss _ebss Dynamic memory 0x6016FEFC A0 A1 A0 + ROMFS size A1 + ROMFS size Copy data from end forwards – VBR set to start of RAM, overwriting kernel – Set _ramvec to ColdFire internal SRAM ● Finally a working kernel! – But...
  • 9. ● 2Mb of DRAM doesn't give even uClinux much room to do anything – After 3 commands, memory is too fragmented to load programs: Porting uClinux to the Pluto 6 – Romfs contents restricted – Tools are required to test drivers /bin> vi __alloc_pages: 0-order allocation failed (gfp=0x1d2/0) __alloc_pages: 4-order allocation failed (gfp=0x1f0/0) Allocation of length 65000 from process 20 failed Free pages: 136kB ( 0kB HighMem) Zone:DMA freepages: 0kB Zone:Normal freepages: 136kB Zone:HighMem freepages: 0kB ( Active: 5, inactive: 27, free: 34 ) = 0kB) 6*4kB 2*8kB 2*16kB 0*32kB 1*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB = 136kB) = 0kB)
  • 10. Running the kernel from VRAM ● Problem: program counter incrementing incorrectly ● Possibly cache related
  • 11. ● Initial solution to use video card RAM ● Solution found and borrowed from Heber: Getting more memory ● Finally a working USABLE kernel! FPGA for DRAM to local bus decoding DRAM Battery 16Mb local bus interface DRAM card
  • 12. ● Vacuum Fluorescent Display – Simple character device – Clock ASCII characters in through 2 line serial port Time to write some drivers! /> echo hello world! > /dev/vfd0
  • 13. ● FPGA controls 256 lamps as 16 strobes of 32, each has 8 brightness levels ● Every 1ms, software must: – fill 8 32 bit data registers, each bit corresponds to one lamp – Write the strobe number to illuminate to the MPX control register in the FPGA ● The FPGA splits the 1ms period into 8 segments, using 1 data register for each ● Each bit of each data register = 1/8ms Multiplexed lamp driver
  • 14. ● Problem: – Kernel timer used to rewrite lamp registers every millisecond – Interrupt set for next jiffy, which is incremented by timer interrupt – Timer interrupt frequency determined by HZ – HZ default is 100 (every 10ms) – Lamps flash (on for 1ms, off for 9ms) – Increased HZ to 1000 Multiplexed lamp driver
  • 15. ● Choosing interface to user space – Write a char for brightness of each lamp ● 1 file for all 256 lamps – Big overhead to change 1 lamp ● 1 file for each lamp – 256*3*2=1536 context switches ● Best compromise – 1 file for each lamp strobe Multiplexed lamp driver
  • 16. Multiplexed lamp driver /> echo 0123456776543210 > /dev/lamps10 /> echo 0707070707070707 > /dev/lamps15
  • 17. Frame buffer driver ● Graphics were a key part of project ● Two options – Port a Denx Coral P X server on a PPC board accessed through PCI running full Linux – Write a frame buffer driver from scratch Cremson video controller DRAM Fujitsu Calypso 32 Graphics card
  • 18. Frame buffer driver ● Not a lot of design required ● But understanding of sub system is required ● Values written to Cremson stored in a par structure – Initial par instance with set values used for testing ● 1024x768x16 fb_info fb_var_screeninfo fb_fix_screeninfo fb_monospecs fb_ops * fb_ops fbgen_get_fix() fbgen_get_var() fbgen_set_var() fbgen_get_cmap() fbgen_set_cmap() fbgen_pan_display()fb_cmap display * display Par * cremsonfb_info fb_info_gen fbgen_hwswitch * cremsonfb_switch cremson_detect() cremson_encode_fix() cremson_decode_var() cremson_encode_var() cremson_get_par() cremson_set_par() cremson_get_getcolreg() cremson_set_getcolreg() cremson_pan_display() cremson_blank() cremson_set_disp() uint32_t fbcon_cmap[256] void *screen_base_phys void *screen_base_virt uint32_t vid_mem_len par Cremson register copies unsigned int parsize
  • 19. Frame buffer driver ● Lots of code mistakes before finally:
  • 20. Frame buffer driver ● Endian issue, added byte swaps to macros in fb_con.h:
  • 21. Frame buffer driver ● Forgot to allocate memory to 16 entry console pseudo palette:
  • 22. Frame buffer driver ● Had a try with 8 bit indirect colour mode ● Created a new par instance
  • 23. Frame buffer driver ● Set bit field lengths in fb_var_screeninfo to 8:
  • 24. Frame buffer driver ● Set layer width in Cremson correctly:
  • 25. Frame buffer driver ● Finally, set the palette tables in video memory in cremson_setcolreg():
  • 26. Nano X ● A pain to compile
  • 27. IDE ● Used a generic driver provided by uClinux ● FPGA outputs same interrupt level for CompactFlash and Cremson ● Lots of trouble with Cremson Vsync interrupt while unmasking in ColdFire for the IDE – Mask Vsync on Cremson – Unmask interrupt vector on ColdFire ● Copied romfs to CompactFlash card ● Altered kernel command line to mount as root FS
  • 28. eXecute In Place ● Tried XIP with romfs – Romfs scrambled when copying .data and .init from ROM area to RAM area – No need for romfs with a working disk present ● Added initial vector table to crt0_rom.S ● Split DRAM card into 2 Mb "ROM" and the rest as RAM area ● Could finally boot straight into uClinux at power on MEMORY { flash : ORIGIN = 0x00000000, LENGTH = 0x00200000 ram : ORIGIN = 0x00200000, LENGTH = 0x00E00000 }
  • 29. ● Project was successful ● Verdict – Board is rather slow – Accumulated knowledge for future Heber boards ● Lessons learned – Understand code before starting ● learned lesson porting ● used lesson on frame buffer – Learned lots about kernel programming Conclusion