1
Offtopic / Frohe Weihnacht
« am: 24. December 2015, 12:53 »
Ich wünsche euch allen ein frohes Fest und Gesundheit.
Relbmessa
Relbmessa
02. January 2025, 19:50
Diese Sektion erlaubt es dir alle Beiträge dieses Mitglieds zu sehen. Beachte, dass du nur solche Beiträge sehen kannst, zu denen du auch Zugriffsrechte hast.
/********************************************************/
/* DANK PETER LEMON */
/*Dual Raspberry Pi */ /*Test IRQ */
.section .init
.globl _start
_start:
/*; Setup Frame Buffer */
SCREEN_X = 1024
SCREEN_Y = 768
BITS_PER_PIXEL = 24
BASIS_ADD =0x20000000 /* Pi 2B 0x3F000000 */
@CS_TIMER =0x3000
/*; Setup */
/*; Setup SMP (Boot Offset = $4000008C + ($10 * Core), Core = 1..3)
/*;Core1Boot = $4000008C + ($10 * 1) ; Core 1 Boot Offset */
Core1Boot = 0x4000009C @ ; Core 1 Boot Offset
/*;Core2Boot = $4000008C + ($10 * 2) ; Core 2 Boot Offset */
Core2Boot = 0x400000AC @ ; Core 2 Boot Offset
/*;Core3Boot = $4000008C + ($10 * 3) ; Core 3 Boot Offset */
Core3Boot = 0x400000BC @ ; Core 3 Boot Offset
@/*-------------------------------------------------------------------*/
mov sp , #0x8000
b FB_Init
@/*-------------------------------------------------------------------*/
ldr pc,reset_handler
ldr pc,undefined_handler
ldr pc,swi_handler
ldr pc,prefetch_handler
ldr pc,data_handler
ldr pc,unused_handler
ldr pc,irq_handler
ldr pc,fiq_handler
reset_handler: .word resetVector
undefined_handler: .word undVector
swi_handler: .word swiVector
prefetch_handler: .word prefVector
data_handler: .word dataVector
unused_handler: .word reservVector
irq_handler: .word irqVector
fiq_handler: .word fiqVector
/*--------------------------------------------------------------*/
mov r0,r0
mov r0,r0
/*--------------------------------------------------------------*/
FB_Init:
/*;---------------------------------------------------------------*/
mov r0 ,#FB_STRUCT @ mov r0,#FB_STRUCT @ 0xB0
orr r0,#8 /*; MAIL_TAGS*/
orr r0,r0 ,#0x8000
orr r0,r0 ,#0
/*;--------------------------------------------------------------- -------- */
mov r1 ,#BASIS_ADD @0x3F000000 /*;@ Address Mail_Box */
orr r1,r1,#0xB800
orr r1,r1,#0xA0
orr r1,r1,#0 ;
/*;------------------------------------------------------------------------*/
str r0,[r1] @ /*; Mail Box Write */ ;70-7F */
/*;------------------------------------------------------------------------*/
mov r1 ,#FB_POINTER @FB_POINTER 0x2C ;
orr r1 ,r1,#0x8100
orr r1 ,r1,#0
orr r1 ,r1,#0
@;/*;----------------------------------------------------------------------*/
ldr r10,[r1] /* ; R10 = Frame Buffer Pointer ;A0-AF */
cmp r10,#0 /* Compare Frame Buffer Pointer To Zero */
beq FB_Init /* IF Zero Re-Initialize Frame Buffer */
mov r12 , r10
b weiter_programm
/*;----------------------------------------------------------------------------------------------------------*/
Ersatz_align:
.word 0xFFFFFFFF
.word 0xFFFFFFFF @ der achte
/* align 8 */
FB_STRUCT:
.word FB_STRUCT_END - FB_STRUCT
.word 0
.word 0x00048003 /*,Set_Physical_Display*/
.word 0x8
.word 0x8
.word SCREEN_X
.word SCREEN_Y
.word 0x00048004 /*Set_Virtual_Buffer */
.word 0x8
.word 0x8
.word SCREEN_X
.word SCREEN_Y
.word 0x00048005 /*Set_Depth */
.word 0x4
.word 0x4
.word BITS_PER_PIXEL
.word 0x00048009 /*Set_Virtual_Offset */
.word 0x8
.word 0x8
FB_OFFSET_X:
.word 0
FB_OFFSET_Y:
.word 0
.word 0x00040001 /*Allocate_Buffer */
.word 0x8
.word 0x8
FB_POINTER:
.word 0
.word 0
.word 0x0
FB_STRUCT_END:
/*-----------------------------------------------------------*/
/*////////////////////////////////////////////////////////*/
.align 8
resetVector:
push {r0-r12 ,r14}
/* nur Message-------------*/
mov r0 ,#0 /*Spalte */
mov r1 ,#1 /*Zeile */
bl upcurserPos /* Start-Position */
mov r0 , #16 /* 0x10 zeichen */
bl upconvbyte
haltreset:
b haltreset
pop {r0-r12 ,r14}
/*---IRQ-Ende----*/
subs r15 ,r14,#4
/*////////////////////////////////////////////////////////*/
.align 8
undVector:
push {r0-r12 ,r14}
/* nur Message-------------*/
mov r0 ,#0 /*Spalte */
mov r1 ,#2 /*Zeile */
bl upcurserPos /* Start-Position */
mov r0 , #16+1 /* zeichen */
bl upconvbyte
haltund:
b haltund
pop {r0-r12 ,r14}
/*---IRQ-Ende----*/
movs r15 ,r14
/*////////////////////////////////////////////////////////*/
/*////////////////////////////////////////////////////////*/
.align 8
swiVector:
push {r0-r12 ,r14}
/* nur Message-------------*/
mov r0 ,#0 /*Spalte */
mov r1 ,#3 /*Zeile */
bl upcurserPos /* Start-Position */
mov r0 , #16+2 /* zeichen */
bl upconvbyte
@ haltswi:
@ b haltswi
pop {r0-r12 ,r14}
/*---IRQ-Ende----*/
movs r15 ,r14
/*////////////////////////////////////////////////////////*/
/*////////////////////////////////////////////////////////*/
.align 8
prefVector:
push {r0-r12 ,r14}
/* nur Message-------------*/
mov r0 ,#0 /*Spalte */
mov r1 ,#4 /*Zeile */
bl upcurserPos /* Start-Position */
mov r0 , #16+3 /* zeichen */
bl upconvbyte
HALTVector:
b HALTVector
pop {r0-r12 ,r14}
subs r15,r14,#4
/*////////////////////////////////////////////////////////*/
/*////////////////////////////////////////////////////////*/
.align 8
dataVector:
push {r0-r12 ,r14}
/* nur Message-------------*/
mov r0 ,#0 /*Spalte */
mov r1 ,#5 /*Zeile */
bl upcurserPos /* Start-Position */
mov r0 , #16+4 /* zeichen */
bl upconvbyte
haltdata:
b haltdata
pop {r0-r12 ,r14}
@/*---IRQ-Ende----*/
subs r15 ,r14 ,#8
/*////////////////////////////////////////////////////////*/
/*////////////////////////////////////////////////////////*/
.align 8
reservVector:
push {r0-r12 ,r14}
/* nur Message-------------*/
mov r0 ,#0 /*Spalte */
mov r1 ,#6 /*Zeile */
bl upcurserPos /* Start-Position */
mov r0 , #16+5 /* zeichen */
bl upconvbyte
haltreserv:
b haltreserv
pop {r0-r12 ,r14}
/*---IRQ-Ende----*/
movs r15 ,r14
/*////////////////////////////////////////////////////////*/
/*//////////////////////////////////////////////////////////*/
.align 8
irqVector:
push {r0-r12 ,r14}
ldr r0 , =BASIS_ADD
ldr r1 , =0xB40C
add r0 , r1 /* Ziel */
ldr r1 , =0x01
str r1 , [r0]
ldr r0 ,=startProgr
mov r1 ,#1 /* startProgramm ein */
str r1 ,[r0] /* heute */
/*********************************************************/
mov r1 , #1
ldr r0 , =uhrzeitzaehl
ldr r2 , [r0]
add r2 , r1
str r2 , [r0]
/* nur Message-------------*/
@ mov r0 ,#0 /*Spalte */
@ mov r1 ,#7 /*Zeile */
@ bl upcurserPos /* Start-Position */
@ mov r0 , #16+6 /* zeichen */
@ bl upconvbyte
pop {r0-r12 ,r14}
/*---IRQ-Ende----*/
subs r15 ,r14,#4
/*---IRQ-Ende----*/
/*////////////////////////////////////////////////////////*/
.align 8
fiqVector:
push {r0-r12 ,r14}
/* nur Message-------------*/
mov r0 ,#0 /*Spalte */
mov r1 ,#8 /*Zeile */
bl upcurserPos /* Start-Position */
mov r0 , #16+7 /* zeichen */
bl upconvbyte
haltfiq:
b haltfiq
pop {r0-r12 ,r14}
/*---IRQ-Ende----*/
subs r15 ,r14 ,#4
/**********************************************************/
/*////////////////////////////////////////////////////////*/
@/*------------ UP ---------------------------------------*/
up_cursor:
push {r4-r12}
mov r6 ,r4 @ offset /startpunkt
mov r4 ,#16 @ anzahl spalte
mov r5 ,r4 @ anzahl zeile
loop_cursor:
strb r1 , [r0,r6] @ blue
add r0 , #1
strb r2 , [r0,r6] @ gruen
add r0 , #1
strb r3 , [r0,r6] @ rot
add r0 , #1
sub r4 , #1 @ spalte
cmp r4 , #0
bne loop_cursor
mov r4 , #16 @ reset spalte
add r6 , #1024*3 @ nächste zeile
sub r6 , #16*3 @ offset
sub r5 ,#1
cmp r5 ,#0
bne loop_cursor
pop {r4-r12}
mov pc , lr
@/*////////////////////////////////////////////////////////*/
.align 2
.section .data
bws_pointer:
.word 0x0
/*-----------------------------------------------------------*/
bws_hell_rot:
.word 0xFF
bws_hell_gruen:
.word 0x0
bws_hell_blue:
.word 0xFF
bws_anzahl_point:
.word 1024*16 @1024*768
/*-----------------*/
pause_value:
.word 0x003F0000
/*-----------------*/
pause_valueA:
.word 0x000F0000
/*----------------*/
pause_valueB:
.word 0x000F0000*2
/*---------------------------------------------------------------------*/
.align 2
meValueAnzbyte: @ Parameter upsiebenzweiBWS
.int 0x4
meValueAnzZeil:
.int 0x8 @ 20d
@--------------Anzeige zeile 1-8 --------------------------------------*/
.align 8
data_bws0:
.word 0x11111111
data_bws4:
.word 0x22222222
data_bws8:
.word 0x33333333
data_bwsC:
.word 0x44444444
data_bws10:
.word 0x55555555
data_bws14:
.word 0x66666666
data_bws18:
.word 0x77777777
data_bws1C:
.word 0x88888888
data_bws20:
.word 0x0
/*---------------------------------------------------------------------*/
data_bws24:
.word 0x24
data_bws28:
.word 0x0
data_bws2C:
.word 0x0
data_bws30:
.word 0x0
data_bws34:
.word 0x0
data_bws38:
.word 0x0
data_bws3C:
.word 0x0
data_bws40:
.word 0x40
/*-------------------------------------------------------------------*/
data_bws44:
.word 0x44
data_bws48:
.word 0x0
data_bws4C:
.word 0x0
data_bws50:
.word 0x0
data_bws54:
.word 0x0
data_bws58:
.word 0x0
data_bws5C:
.word 0x0
data_bws60:
.word 0x60
/*-------------------------------------------------------------------*/
/*------------------*/
uhrzeitzaehl:
.int 0x0
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
/*=======================================================*/
startProgr:
.int 0x01
weitermitProgramm:
.int 0x0
prMatrixXXX:
.int Proffset
.int Pr001 , Pr002 , Pr003 , Pr004 , Pr005 , Pr006 , Pr007 , Pr008 , Pr009 , Pr010
.int Pr011 , Pr012 , Pr013 , Pr014 , Pr015 , Pr016 , Pr017 , Pr018 , Pr019 , Pr020
/*;--------------------------------------------------------------------*/
weiter_programm:
@/*-------------------------------*/
/*============================================================*/
/* ISR Vectoren */
/************************************************************/
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ ------------- IVT Pointer -------------------------------
mov r0 , #8 @;Anzahl
ldr r1 , =0xEA000006 @;value sprung
mov r2 , #0 @; ram null
ivt_pointer0:
str r1 ,[r2]
add r1 ,#2
add r2 ,#4
sub r0 ,#1
cmp r0 ,#0
bne ivt_pointer0
@----------------ENDE------------------------------------
@;;;;;; lade E59FF000------------------------------------
mov r0 , #8 @;Anzahl
ldr r1 , =0xE59FF000 @;ldr PC, [PC]
mov r2 , #32 @; ram start 0x20
ivt_pointer1:
str r1 ,[r2]
@add r1 ,#2
add r2 ,#12 @ Abstand 0x0C
sub r0 ,#1
cmp r0 ,#0
bne ivt_pointer1
@----------------ENDE------------------------------------
@;;;;;;;;; address händler-------------------------------
mov r0 , #8 @;Anzahl
ldr r1 , =0x00008008 @;Erster reset_handler
mov r2 , #40 @; ram 40 0x28
ivt_pointer2:
str r1 ,[r2]
add r1 ,#4
add r2 ,#12 @ Abstand 0x0C
sub r0 ,#1
cmp r0 ,#0
bne ivt_pointer2
@----------------ENDE-------------------------------------------
@------------------------------------------------------------------------------
@ Test pi 2B Programm twG (testen)
@ gcc -o twG twG.s
@------------------------------------------------------------------------------
@ as -o twG.o twG.s -> main ersetzen mit _start sonst Fehlermeldung
@ ld -o twG twG.o
@------------------------------------------------------------------------------
.global main @ gcc -o
@ .global _start @ as -o -> ld -o
.section .data
@------------------------------------------------------------------------------
@------------------------------------------------------------------------------
fd_in:
.int 0x0
fd_out:
.int 0x0
@--------------------------
reserve:
.int 0x0
@----------parameter- sleep---------------------------------------------------
time_value:
.int 0 @ Sekunde
.int 2000000 @ 10mS /100mS 100000000
@------------------------------------
file_reada:
.asciz "/dev/shm/A/B640x480rgb0"
.align 2
@---write--------------------------
file_write2:
.asciz "/dev/shm/G/B640x480rgb0"
.align 2
@------------------------------------------------------------------------------
buffer_a:
.space 1024*901
@-Ende section .data---------------------------------------------------------
@-----------------------------------------------------------------------------
main: @ gcc
@ _start: @ as -> ld
mov r4 , #71 @ G
mov r5 , #72 @ H
@-----------------------------------
mov r3 , #65 @ A
mov r6 , #66 @ B
mov r8 , #1024 @ schleife
ldr r9 , =0x1 @ für Test
ldr r10 , =18 @ für Test 18d
@-----------------------------------------------------------------------------
loop_neu:
@--open the file for reading---hole Bilddavor (/C/B640x480rgb0)---------------
ldr r0 , =file_reada @
strb r3 , [r0,#9] @ pfad A oder B
mov r1 , #2 @ read
ldr r2 , =444 @ all
mov r7 , #5 @ syscall 5 open file
swi 0
ldr r1 , =fd_in
str r0 , [r1] @ Rückgabe-Wert
@-----------------------------------------------------------------------------
@-- read from file------------------------------------------------------------
@ ldr r1 , =fd_in
@ ldr r0 , [r1] @ deskriptor fd_in
ldr r1 , =buffer_a @ Zeiger -> Anfang der Daten
mov r2 , #1024*900
add r2 , #15 @ Anzahl Byte hier (900,0kiB 921615 Byte)
mov r7 , #3 @ syscall 3 -> read file
swi 0
@-----------------------------------------------------------------------------
@--close the file-------------------------------------------------------------
mov r7 , #6
@ ldr r1 , =fd_in
@ ldr r0 , [r1] @ deskriptor fd_in
swi 0
@------------------------------------------------------------------------------
str r9 , [r1, r10] @ r10 =ziel
add r9 , #1 @ kontrolle anzahl
@---lesen Ende-----------------------------------------------------------------
@-----create -----------------------------------------------------
ldr r0 , =file_write2
strb r4 , [r0,#9] @ pfad G H
ldr r1 , =444
mov r7 , #8 @ syscall 8 create
swi 0
ldr r1 , =fd_out
str r0 , [r1]
@-----write file---------------------------
mov r2 , #1024*900
add r2 , #15
ldr r1 , =buffer_a @ Quelle (Ergebnis)
@@ ldr r1 , =fd_out
@@ str r0 , [r1]
mov r7 , #4 @ syscall write 4
swi 0
@------------------------------------------
@@ ldr r1 , =fd_out
@@ str r0 , [r1]
mov r7 , #6 @ close
swi 0
@-----sleep sys 162 ----------------------------------------------------------
mov r7 , #162
ldr r0 , =time_value
mov r1 , #0
swi 0
@---------Test pfad read -----------------------------------------------------
add r3 , #1
cmp r3 , r6
ble pfadr_ok
sub r3 , #2
pfadr_ok:
@---------Test pfad write ----------------------------------------------------
add r4 , #1
cmp r4 , r5
ble pfad_ok
sub r4 , #2
pfad_ok:
@---------Durchlauf für Test--------------------------------------------------
@@ sub r8 , #1
@@ cmp r8 , #0
@@ bne loop_neu
b loop_neu @ max 0x01FE 510d -> warum ??
@-----------------------------------------------------------------------------
@--syscall exit 1 ------------------------------------------------------------
mov r7 , #1
mov r0 , #0
swi 0 @ Ende