Показаны сообщения с ярлыком asm. Показать все сообщения
Показаны сообщения с ярлыком asm. Показать все сообщения

четверг, 19 сентября 2024 г.

IDA Pro

habr:
1) IDA Pro и техники реверс-инжиниринга https://habr.com/ru/companies/inforion/articles/493416/
2) IDA Pro: 11 советов, которые вы (может быть) не знали https://habr.com/ru/articles/439740/
3) Видеокурс «Введение в реверсинг с нуля, с использованием IDA PRO. Глава 1» https://habr.com/ru/articles/461865/
5) IDA Pro: каким не должен быть SDK https://habr.com/ru/articles/509678/
6) IDA Pro: работа с библиотечным кодом (не WinAPI) https://habr.com/ru/articles/509148/
7) Пишем дизассемблер виртуальной машины из игры Clock Tower (PS1/PC) для IDA Pro https://habr.com/ru/articles/573830/
8) Реверс инжиниринг для самых маленьких на практике https://habr.com/ru/articles/724808/

download:

вторник, 26 декабря 2023 г.

Different stack in priviledged and user mode in cortex a15


1. privileged and user mode from ARM Architecture Manual ARMv7-A and ARMv7-R edition

"A3.6.1 Processor privilege levels, execution privilege, and access privilege
As introduced in About the Application level programmers’ model on page A2-38, within a security state, the ARMv7 architecture defines different levels of execution privilege:
• in Secure state, the privilege levels are PL1 and PL0
• in Non-secure state, the privilege levels are PL2, PL1, and PL0.

PL0 indicates unprivileged execution in the current security state.
The current processor mode determines the execution privilege level, and therefore the execution privilege level can be described as the processor privilege level.

Every memory access has an access privilege, that is either unprivileged or privileged.

The characteristics of the privilege levels are:

1) PL0 The privilege level of application software, that executes in User mode. Therefore, software
executed in User mode is described as unprivileged software. This software cannot access some
features of the architecture. In particular, it cannot change many of the configuration settings.
Software executing at PL0 makes only unprivileged memory accesses.

2) PL1 Software execution in all modes other than User mode and Hyp mode is at PL1. Normally, operating system software executes at PL1. Software executing at PL1 can access all features of the
architecture, and can change the configuration settings for those features, except for some features
added by the Virtualization Extensions that are only accessible at PL2.

Note In many implementation models, system software is unaware of the PL2 level of privilege, and of
whether the implementation includes the Virtualization Extensions.

The PL1 modes refers to all the modes other than User mode and Hyp mode.
Software executing at PL1 makes privileged memory accesses by default, but can also make
unprivileged accesses.

3) PL2 Software executing in Hyp mode executes at PL2.
Software executing at PL2 can perform all of the operations accessible at PL1, and can access some
additional functionality.
Hyp mode is normally used by a hypervisor, that controls, and can switch between, Guest OSs, that
execute at PL1.


2. run-time initialization of c program

8.11.1 Run-Time Initialization from TI Assembly Guide
"All C/C++ programs must be linked with code to initialize and execute the program, called a bootstrap routine, also known as the boot.obj object module. The symbol _c_int00 is defined as the program entry point and is the start of the C boot routine in boot.obj; referencing _c_int00 ensures that boot.obj is automatically linked in from the run-time-support library. When a program begins running, it executes boot.obj first. The boot.obj symbol contains code and data for initializing the run-time environment and performs the following tasks:
• Changes from system mode to user mode
• Sets up the user mode stack
• Processes the run-time .cinit initialization table and autoinitializes global variables (when the linker is invoked with the --rom_model option)
• Calls main
The run-time-support object libraries contain boot.obj. You can:
• Use the archiver to extract boot.obj from the library and then link the module in directly.
• Include the appropriate run-time-support library as an input file (the linker automatically extracts
boot.obj when you use the --ram_model or --rom_model option)."


3. stack - регистр R13 (SP)

6.1.2 C/C++ System Stack from ARM Optmizing C/C++ Compiler

"The run-time stack grows from the high addresses to the low addresses. The compiler uses the R13 register to manage this stack. R13 is the stack pointer (SP), which points to the next unused location on the stack.

The linker sets the stack size, creates a global symbol, __TI_STACK_SIZE, and assigns it a value equal to the stack size in bytes. The default stack size is 2048 bytes. You can change the stack size at link time by using the --stack_size option with the linker command. For more information on the --stack_size option, see the linker description chapter in the ARM Assembly Language Tools User's Guide.

At system initialization, SP is set to a designated address for the top of the stack. This address is the first location past the end of the .stack section. Since the position of the stack depends on where the .stack section is allocated, the actual address of the stack is determined at link time.

The C/C++ environment automatically decrements SP at the entry to a function to reserve all the space
necessary for the execution of that function. The stack pointer is incremented at the exit of the function to restore the stack to the state before the function was entered. If you interface assembly language routines to C/C++ programs, be sure to restore the stack pointer to the same state it was in before the function was entered."

Links:

4. heap

6.1.3 Dynamic Memory Allocation from ARM Optmizing C/C++ Compiler

"The run-time-support library supplied with the ARM compiler contains several functions (such as malloc, calloc, and realloc) that allow you to allocate memory dynamically for variables at run time.

Memory is allocated from a global pool, or heap, that is defined in the .sysmem section. You can set the size of the .sysmem section by using the --heap_size=size option with the linker command. The linker also creates a global symbol, __TI_SYSMEM_SIZE, and assigns it a value equal to the size of the heap in bytes. The default size is 2048 bytes. For more information on the --heap_size option, see the linker description chapter in the ARM Assembly Language Tools User's Guide.

If you use any C I/O function, the RTS library allocates an I/O buffer for each file you access. This buffer will be a bit larger than BUFSIZ, which is defined in stdio.h and defaults to 256. Make sure you allocate a heap large enough for these buffers or use setvbuf to change the buffer to a statically-allocated buffer.

Dynamically allocated objects are not addressed directly (they are always accessed with pointers) and the memory pool is in a separate section (.sysmem). Therefore, the dynamic memory pool size may be limited only by the amount of memory in your system. To conserve space in the .bss section, you can allocate large arrays from the heap instead of defining them as global or static. For example, instead of a definition such as:
struct big table[100];

Use a pointer and call the malloc function:
struct big *table
table = (struct big *)malloc(100*sizeof(struct big));

When allocating from a heap, make sure the size of the heap is large enough for the allocation. This is particularly important when allocating variable-length arrays."

Links:

вторник, 8 февраля 2022 г.

LLVM

Habr, wiki:
2) Что такое LLVM и зачем он нужен? https://habr.com/ru/company/huawei/blog/511854/
3) Мой первый компилятор на LLVM https://habr.com/ru/post/342456/
5) Осваиваем кросс-компиляцию с помощью Clang и LLVM https://habr.com/ru/post/591979/
6) Использование библиотеки LLVM для генерации кода регулярных выражений https://habr.com/ru/post/563570/
7) Путеводитель по исходникам LLVM https://habr.com/ru/post/343344/
8) LLVM: компилятор своими руками. Введение https://habr.com/ru/post/277717/
9) LLVM изнутри: как это работает https://habr.com/ru/post/101838/
10) Создание языка программирования с использованием LLVM. Часть 6: Расширение языка: Операторы, определяемые пользователем https://habr.com/ru/post/336080/

Clang:

среда, 8 сентября 2021 г.

Эзотерические и неактуальные языки программирования

Вики, хабр:
2) ArnoldC: язык программирования из цитат Шварценеггера https://habr.com/ru/post/214189/

Теория построения компиляторов:
1) Альфред Ахо, Рави Сети, Джеффри Ульман - Компиляторы. Принципы, технологии, инструменты (djvu)
2) Ахо,Лам,Сети,Ульман - Компиляторы. Принципы, технологии, инструменты (djvu)
3) Вирт Н. Построение компиляторов https://oberoncore.ru/library/compiler_construction
5) О компиляторах и интерпретаторах https://habr.com/ru/post/170735/
6) Компиляция. 1: лексер https://habr.com/ru/post/99162/
7) Карпов В.Э. Классическая теория компиляторов https://bdpx.github.io/compilation/books/karpov-teoriya-kompilyatorov.pdf

Классика:
1) Б. Керниган, Д. Ритчи - С (djvu)
2) Бьерн Страуструп - Язык программирования С++ (djvu)
3) (прочитал)Подбельский В. В., Фомин С. С. - Программирование на языке Си (djvu)
4) (прочитал)Подбельский В. В. - Язык Си++ (djvu)

5) Гриффитс А. - GCC. Полное руководство (djvu)
6) Meyers - Effective STL (djvu)
7) Н. Джосьютис - C++. Стандартная библиотека (djvu)
8) Л. Аммерааль - STL для программистов на C++ (djvu)

Полнота по Тьюрингу:
3) Неожиданная полнота по Тьюрингу повсюду https://habr.com/ru/articles/429602/
5) Что такое полнота по Тьюрингу? Душкин объяснит https://www.youtube.com/watch?v=gFwEQ3A9HnE

Неактуальные языки программирования:
2) История языков программирования: Algol — жертва конфликта интересов https://habr.com/ru/articles/317010/
6) Программирование на языке Ада https://habr.com/ru/companies/parallels/articles/430924/
7) Почему вам стоит использовать язык Ада для программирования вашей системы https://habr.com/ru/articles/469671/
9) Prolog — удивительный язык программирования https://habr.com/ru/articles/124636/
10) Логическое программирование на Prolog для чайников https://habr.com/ru/articles/552318/
12) COBOL — древний код, который управляет вашими деньгами https://habr.com/ru/articles/532554/
15) Язык сломаешь. Советские алгоритмические языки для обучения программированию https://habr.com/ru/companies/ruvds/articles/692594/

Языки, придуманные Виртом:

Функциональные языки программирования

Вики:
3) Тернистая история Лисп-машин: первый бум AI, война Столлмана и удивительный интерфейс https://habr.com/ru/company/yandex/blog/519922/

понедельник, 16 августа 2021 г.

Модель памяти и lock-free структуры

Модель памяти:
1) http://www.1024cores.net/home/in-russian/cto-takoe-model-pamati-i-s-cem-eee-edat
2) https://tproger.ru/articles/low-level-memory/
3) https://prog-cpp.ru/asm-memory/

Lock-free структуры данных:
1) Lock-free структуры данных. Основы: Модель памяти https://habr.com/ru/post/197520/
2) Lock-free структуры данных. 1 — Начало https://habr.com/ru/post/195770/
3) Lock-free структуры данных. Извне: введение в libcds https://habr.com/ru/post/196834/
4) Lock-free структуры данных. Внутри. Схемы управления памятью https://habr.com/ru/post/202190/

пятница, 21 августа 2020 г.

ti gel- and cmd-files; add aem4 lib in ccs

Wiki, pdf (gel-file):
1) Creating Device Initialization GEL Files https://www.ti.com/lit/an/spraa74a/spraa74a.pdf

Funcs:
1) https://software-dl.ti.com/ccs/esd/documents/users_guide/gel/GEL_MapOff.html
2) https://software-dl.ti.com/ccs/esd/documents/users_guide/gel/GEL_MapReset.html
3) https://software-dl.ti.com/ccs/esd/documents/users_guide/gel/GEL_MapAddStr.html
4) https://software-dl.ti.com/ccs/esd/documents/users_guide/gel/GEL_LoadGel.html
5) http://software-dl.ti.com/ccs/esd/documents/users_guide_9.3.0/gel/OnTargetConnect.html

cmd-file:
1) https://software-dl.ti.com/ccs/esd/documents/sdto_cgt_Linker-Command-File-Primer.html
2) https://processors.wiki.ti.com/index.php/Linker_CMD_Files_for_CCS
3) Advanced Linker Techniques for Convenient and Efficient Memory Usage 
pragma DATA_SECTION(), CODE_SECTION():
1) Using DATA_SECTION PRAGMA With Defined Memory Section in Linker Command File
https://processors.wiki.ti.com/index.php/Placing_Variables_in_Specific_Memory_Location_-_MSP430#Using_DATA_SECTION_PRAGMA_With_Defined_Memory_Section_in_Linker_Command_File
2) ti c/c++ and assembly language compilers user guides https://www.ti.com/tool/TI-CGT#technicaldocuments
3) #pragma DATA_SECTION() expansion https://e2e.ti.com/support/tools/ccs/f/81/t/277661
4) https://stackoverflow.com/questions/1675351/typedef-struct-vs-struct-definitions
5) #pragma CODE_SECTION('.startup_code') https://e2e.ti.com/support/tools/ccs/f/81/t/41618?-pragma-CODE-SECTION-applying-to-files-groups-of-functions-

.bss:
1) https://en.wikipedia.org/wiki/.bss

add aem4 lib in ccs:
1) https://e2e.ti.com/support/processors/f/791/t/564044?CCS-Undefined-symbol-in-build-for-AM571x-M4

Error connecting to the target: (Error -1170 @ 0x0) Unable to access the DAP:

понедельник, 27 июля 2020 г.

Кольцевые и пинг-понг буферы

Пинг-понг:
1) (ti c6000) Implementing a Double Buffered System on DSP C6000

Кольцевые:
1) Кольцевой буфер
2) https://en.wikipedia.org/wiki/Circular_buffer
3) http://www.scicompiler.cloud/userguide/CircularBuffer.html
4) https://embeddedartistry.com/blog/2017/05/17/creating-a-circular-buffer-in-c-and-c/
5) https://www.youtube.com/watch?v=uvD9_Wdtjtw
6) https://medium.com/@abhinavagarwal1996/a-fast-circular-ring-buffer-4d102ef4d4a3
7) https://www.embedded.com/ring-buffer-basics/
8) ring buffer for arduino https://github.com/Locoduino/RingBuffer

Полифазные буферы:
1) http://ntlab.com/IP/rus/Hard/Analog_Mixed/MIXER/180SMIC_MIX_02R.pdf
2) http://ntlab.com/IP/rus/Hard/Analog_Mixed/MIXER/350AMS_MIX_07R.pdf
3) Как реализовать анализирующий полифазный косинусно модулированный банк фильтров по синтезирующему? https://qna.habr.com/q/678812
4) ДВУХКАНАЛЬНЫЙ БАНК ФИЛЬТРОВ НА ОСНОВЕ ЛЕСТНИЧНЫХ СТРУКТУР И АРИФМЕТИКИ С ФИКСИРОВАННОЙ ЗАПЯТОЙ ПЕРЕМЕННОГО ФОРМАТА
http://www.dspa.ru/articles/year2010/jour10_2/art10_2_3.pdf
5) Устройство цифровой обработки полифазных дополнительных фазокодоманипулированных сигналов https://rusneb.ru/catalog/000224_000128_0002647632_20180316_C1_RU/
6) http://www.rsreu.ru/component/docman/doc_download/2047-tor-slajdy-po-distsipline-tsifrovye-tsepi-i-signaly

Конвейеризация:

среда, 15 июля 2020 г.

ti ccs

1. Чтобы вызвать диалог Find in Files в ccs8 надо нажать "ctrl"+H. Выбираем tabpad "remote search", вводим в поле "Search string" искомую строку, выбираем папку в комбобоксе "Folder", ставим чекбокс "Search subfolders" для просмотра подпапок.

Ссылки:
1) https://e2e.ti.com/support/tools/ccs/f/81/p/154598/560640#560640

2. Включить хэдеры в сборку проекта можно во вкладке проекта Properties-ARM Compiler-Include Options:


3. Добавить путь к собранным либам vision sdk и сами либы можно в пункте Properties-Build-ARM Linker-File Search Path. Добавить путь, куда вы собираетесь скинуть собранные либы (у меня C:\ti\pdk_libs), можно в пункте "Add <dir> to library search path". А добавить сами либы в пункте "Include library file".



4. Изменить путь к библиотеке vision sdk (переменная внутри CCS $(SDK_VISION_PACKAGES)) можно во вкладке проекта Properties-Resource-Linked resources:


5. CCS downloads.
5.1. CCS 5.2.1 (windows, linux). CCS5 linux setup.

5.2. CCS 8.3.1 (windows, linux). CCS8 ubuntu setup.
5.3. CCS 11.1.0 (download link).

5.2.1. On Fedora 31 x86_64 you need to install this:

sudo dnf install glibc.i686 ncurses-compat-libs.i686 libusb.i686

Скачиваем установщик, распаковываем, переходим в распакованную папку, запускаем:

sudo ./ccs_setup_linux64_8.3.1.00004.bin

Во время запуска установки ccs8 появляется ошибка:

Failed to locate system libraries required for CCS operation:

 libncurses.so.5
 libnsl.so.1
 libusb-0.1.so.4

Хотя в реальности у меня есть символические ссылки:

[adil@localhost CCS8.3.1.00004_linux-x64]$ ls /usr/lib/ | grep lib*
eclipse
ld-linux.so.2
libanl-2.30.so
libanl.so.1
libBrokenLocale-2.30.so
libBrokenLocale.so.1
libc-2.30.so
libc.so.6
libdl-2.30.so
libdl.so.2
libform.so.5
libform.so.5.9
libformw.so.5
libformw.so.5.9
libgcc_s-9-20190827.so.1
libgcc_s.so.1
libgcrypt.so.20
libgcrypt.so.20.2.5
libgpg-error.so.0
libgpg-error.so.0.27.0
liblz4.so.1
liblz4.so.1.9.1
liblzma.so.5
liblzma.so.5.2.4
libm-2.30.so
libmemusage.so
libmenu.so.5
libmenu.so.5.9
libmenuw.so.5
libmenuw.so.5.9
libm.so.6
libncurses++.so.5
libncurses.so.5
libncurses++.so.5.9
libncurses.so.5.9
libncurses++w.so.5
libncursesw.so.5
libncurses++w.so.5.9
libncursesw.so.5.9
libnss_compat-2.30.so
libnss_compat.so.2
libnss_dns-2.30.so
libnss_dns.so.2
libnss_files-2.30.so
libnss_files.so.2
libnss_myhostname.so.2
libnss_resolve.so.2
libnss_systemd.so.2
libpanel.so.5
libpanel.so.5.9
libpanelw.so.5
libpanelw.so.5.9
libpcprofile.so
libpthread-2.30.so
libpthread.so.0
libresolv-2.30.so
libresolv.so.2
librt-2.30.so
librt.so.1
libSegFault.so
libstdc++.so.6
libstdc++.so.6.0.27
libsystemd.so.0
libsystemd.so.0.27.0
libthread_db-1.0.so
libthread_db.so.1
libtic.so.5
libtic.so.5.9
libtinfo.so.5
libtinfo.so.5.9
libudev.so.1
libudev.so.1.6.15
libusb-0.1.so.4
libusb-0.1.so.4.4.4
libusb-1.0.so.0
libusb-1.0.so.0.1.0
libutil-2.30.so
libutil.so.1

Нажимаем кнопку "continue", соглашаемся на установку в папку "/opt/ti". 
Я оставляю поддержку следующих микропроцессорных технологий:



И всех jtag-отладчиков:


5.2.2. Устанавливаем CCS8.3.1 на win10 x86_64. Установщику нужна папка для временных файлов, он просит создать папку на диске c (c://temp) и снять для неё права только на чтение, разрешить запись. У меня на одной системе снялся атрибут "только чтение" у папки, а на двух других системах остался. После этого запускаем установщик, выбираем путь для установки (у меня по умолчанию c://ti). Выбираем опции как при установке в федоре.

При установке появляется ошибка на стадии "Installing Eclipse...". Я думал, что ошибка вызвана неснятым атрибутом "только для чтения". Ошибка была вызвана слишком длинным директорией, из которой запускается установщик, скорее всего, связано с разархивированием. Пример директории с установщиком, которая вызывала ошибку: "E:\Downloads\avr, stm32, pic, 8051, bbb, raspberrypi, orangepi\dsp\CCS8.3.1.00004_win32". Пример пути, из которого установка прошла успешно: "E:\Downloads\CCS8.3.1.00004_win32".

Ссылки:


5.3. Code Composer Studio 11 (11.2.0.00007 (08 Apr 2022)) (windows, linux).

5.3.1 Установка на Ubuntu/Fedora

Установка зависимостей в Ubuntu описана здесь https://software-dl.ti.com/ccs/esd/documents/ccsv11_linux_host_support.html

5.3.2 Установка на Win10

При установке с именем пользователя в win10 с русскими буквами ccs 11 отказывается ставиться и говорит: "Your temp directory path contains Unicode characters which can corrupt the installation. Please refer to the trouble-shooting guide for a workaround".


В win10 2 временных папки: C:\WINDOWS\Temp и C:\Users\<Username>\AppData\Local\Temp (у меня username Адиль). В trouble-shooting guide сказано, что надо избегать non-unicode characters. Здесь советуют либо поменять временные папки в системе, либо устанавливать файлы из c:/temp.

Оригинальные временные директории:

"Новые" временные директории:




6. Настройка клоков периферии.

Страница с описанием проги ClockTreeTool (аналог cubemx для stm32) 

Oracle Java7 page here.
JRE8 for win10 here.

ClockTreeTool (jar):
1) Описание программы (в нее и из нее можно скачать дамп содержимого регистров ccs или специальной проги omapconf для линукса, поддерживается am335x, на котором сделан beagle bone black ) https://www.ti.com/lit/ug/spruib7i/spruib7i.pdf
2) How to use the Sitara Clock Tree Tool in 5 minutes or less! 

7. xds100v2 jtag bugs.

1) CCS/TMS320F28377D: XDS100 V2 not installed
https://e2e.ti.com/support/tools/ccs/f/81/t/587743?CCS-TMS320F28377D-XDS100-V2-not-installed

Вылечились удалением виндовых драйверов и установкой под локальным администратором (win7 x86_64).


3) Debugger Initialization Error
Fix:
8.5.9. How do I resolve this error when launching a debug session “Could not fetch next record for SQL statement” and running fsclean does not help. 
Try deleting the target cache files as described in the Troubleshooting chapter

9.7.5. Delete Target Cache Files

CCS has a utility called fsclean that removes the most important cache files. This utility is typically installed under [CCS INSTALL FOLDER]/ccsv[x]/ccs_base/common/bin.

The cache files removed by fsclean are saved in a user and CCS installation specific location:
Windows: the location is: C:\Users\[username]\AppData\Local\Texas Instruments\CCS\[CCSV[x] INSTALL FOLDER]\0\0.
Linux/OSX: there is a hidden directory named .ti/[CCSV[x]INSTALL FOLDER]/0/0 and located in the user area. The location is ~/.ti.

Trace cache files are usually saved in similar locations:
Windows: the location is: C:\Users\[username]\.TI-trace
Linux/OSX: there is a hidden directory named .TI-trace and located in the user area. The location is ~/.TI-trace.

cmd (window shell):
cd C:\Users\YOV\AppData\Local\Texas Instruments\CCS\ccs831\0\0>
del .lock
del xpti.dat

cmd (window shell):
cd C:\Users\YOV\.TI-trace
del data
del settings


- пересоздал файл ccxml с конфигурацией
- удалил кэш следующим образом:

cmd (window shell):
cd C:\ti_830\ccsv8\ccs_base\common\bin
C:\ti_830\ccsv8\ccs_base\common\bin>fsclean.bat
Removing temporary files...
boost::filesystem::remove: ╧ЁюЎхёё эх ьюцхЄ яюыєўшЄ№ фюёЄєя ъ Їрщыє, Єръ ъръ ¤Єю
Є Їрщы чрэ Є фЁєушь яЁюЎхёёюь: "C:\Users\YOV\AppData\Local\Texas Instruments\CCS
\ti_830\0\0\targetdb.dat"


8. Debug server scripting (DSS):

9. Как отобразить пиксельные данные из памяти (например, DDR) в вьюхе (Window->Show View->Others->Analysis views->Image)

Ссылки:

10. Как скопировать байтовый массив из CCS, чтобы посмотреть картинку:


11. printf not printing in Console Window in Code Composer Studio v8:
6) MSP430 Optimizing C++ Compiler https://www.ti.com/lit/ug/slau132y/slau132y.pdf


Solution.
- Remove the project from the workspace with right click > delete
- Import it again with project>import existing CC5/CCE Eclipse project

PROJECT_LOC is now at the right value.

I think when I first moved the workspace, and opened it, CCS didn't check if the path was the same, and kept the old value.

13. memery mapped register in expressin window by address:
*(int*)0x4a009120 (CM_DSS_DSS_CLKCTRL)


14. jtag-test failed

links:

15. При работе и сборке в CCS 10 в правом нижнем углу появляется сообщение 
"Remote System Explorer Operation" и это приводит к тормозам среды на очень хорошем компьютере. Вылечить это можно отключив плагин https://stackoverflow.com/questions/1631817/remote-system-explorer-operation-causing-freeze-for-couple-of-seconds

16. В папке .metadata\.plugins\org.eclipse.cdt.ui\ пишется лог сборок global-build.log, который занимает со временем разростается, его надо чистить. И еще есть .metadata\.plugins\org.eclipse.core.resources\.history - папка с историей изменений, которые тоже нужно чистить.

воскресенье, 24 мая 2020 г.

GNU asm

Using gnu asm with c:
1) https://gcc.gnu.org/onlinedocs/gcc/Using-Assembly-Language-with-C.html
2) https://stackoverflow.com/questions/35090479/why-does-gcc-std-c99-treat-the-keyword-asm-as-a-function
3) https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html
4) https://gcc.gnu.org/onlinedocs/gcc/Constraints.html#Constraints
5) https://gcc.gnu.org/onlinedocs/gcc/Simple-Constraints.html#Simple-Constraints
6) https://gcc.gnu.org/onlinedocs/gcc/Modifiers.html#Modifiers
7) https://gcc.gnu.org/onlinedocs/gcc/Multi-Alternative.html#Multi-Alternative

Вики:
1) https://ru.wikipedia.org/wiki/GCC_Inline_Assembly
2) https://ru.wikipedia.org/wiki/GNU_Assembler
3) Ассемблер в Linux для программистов C
4) https://ru.wikipedia.org/wiki/MASM
5) https://ru.wikipedia.org/wiki/TASM
6) Assembler
7) AT&T синтаксис
8) Intel синтаксис
9) Плоская модель памяти

GNU asm:
1) Руководство по ассемблеру x86 для начинающих https://habr.com/ru/post/423077/
2) Постигаем Си глубже, используя ассемблер https://habr.com/ru/post/344896/
3) Постигаем Си глубже, используя ассемблер. Часть 2 (условия) https://habr.com/ru/post/345460/
4) Минималистичная программа в формате ELF https://habr.com/ru/post/137706/

Обзорные:
1) Как писать на ассемблере в 2018 году https://habr.com/ru/post/345748/
2) Список ресурсов для изучения Ассемблера https://habr.com/ru/post/131971/
3) MASM, TASM, FASM, NASM под Windows и Linux https://habr.com/ru/post/326078/

ARM asm:
1) ARM ассемблер (продолжение) https://habr.com/ru/post/188712/
2) ARM аccемблер https://habr.com/ru/post/133808/

STM32 asm:
1) Мигаем светодиодом в STM32 на ассемблере https://habr.com/ru/post/405959/
2) Программирование stm32 с самых основ https://habr.com/ru/post/354670/
3) http://we.easyelectronics.ru/STM32/asm-v-stm32-nachalo.html
4) https://narodstream.ru/stm-urok-201-assembler-pervyj-proekt-komandy-mov-ldr-str-b-chast-1/
5) STM32: GNU AS: Программирование на ассемблере https://www.pvsm.ru/stm32/108025
6) http://stm32asm.ru/
7) http://mcu.goodboard.ru/viewtopic.php?id=23
8) https://edu.milandr.ru/upload/iblock/a6d/a6dc8c4f204d6fb4e1ac5d68212a1305.pdf

AVR asm:
1) http://easyelectronics.ru/avr-uchebnyj-kurs-makroassembler.html
2) https://dfe.karelia.ru/koi/posob/avrlab/avrasm-rus.htm
3) https://ph0en1x.net/79-avr-asm-first-program-for-microcontroller.html
4) http://microsin.net/programming/avr/avr-gcc-inline-assembler.html
5) AVR Ассемблер. Урок 1. Вводный. AVR Assembler. Lesson 1. Promo. https://www.youtube.com/watch?v=e41WqsgwZQg
6) Как понять ассемблер для AVR https://habr.com/ru/post/201528/
7) Программирование МК AVR на языке assembler в среде Linux https://habr.com/ru/post/373677/
8) http://smartep.ru/index.php?page=avr_asm_examples

Cisc asm instructions:
1) Agner Fog - Instruction tables: Lists of instruction latencies, throughputs and micro-operation breakdowns for Intel, AMD and VIA CPUs https://www.agner.org/optimize/instruction_tables.pdf
2) https://en.wikipedia.org/wiki/X86_instruction_listings

GCC, LLVM:
1) https://ru.wikipedia.org/wiki/GNU_Compiler_Collection
2) https://ru.wikipedia.org/wiki/LLVM

среда, 8 апреля 2020 г.

Размещение данных в памяти

Выравнивание в структурах в си, упаковка:
1) https://en.wikipedia.org/wiki/Data_structure_alignment
2) https://stackoverflow.com/questions/4306186/structure-padding-and-packing
3) Битовое поле
4) https://prog-cpp.ru/comp-data/
5) https://prog-cpp.ru/category/asm-posts/

Прямой код для представления рациональных и целых, обратный и дополнительный:
1) Прямой код
2) Обратный код
3) Дополнительный код (преобразование в hex)

Порядок следования байтов (big endian, little endian):

volatile:

inline-функции в c и c++:

Функции c:
1) аллюзии к хранению в std::vector https://ru.wikipedia.org/wiki/Memcpy
2) itoa (первая реализация у K&R)
3) memset — сторона тьмы https://habr.com/ru/post/272269/

vfpv3:
1) Почти все, что вы хотели знать про плавающую точку в ARM, но боялись спросить https://habr.com/ru/companies/embox/articles/418295/

вторник, 24 марта 2020 г.

Как работает процессор (кэш процессора, предсказатель переходов и т.д.)

Предсказатель переходов, спекулятивность современного процессора:
1) https://en.wikipedia.org/wiki/CPU_cache (на русском)
2) https://en.wikipedia.org/wiki/Branch_predictor (на русском)
3) https://en.wikipedia.org/wiki/Memory_timings
4) История предсказания переходов с 1 500 000 года до н.э. по 1995 год
5) https://fcenter.ru/online/hardarticles/processors/13736-Pentium_4_Misticheskij_i_zagadochnyj_Trace_kesh
6) https://wfoojjaec.eu.org/ru/projects/news/2019-05-16-what-is-speculative-execution.html
7) Распараллеливание вычислений за счет использования кастомного предиктора в проекте DVM (1, 2)

Описание работы кэша в TI c66x:
1) Многоядерный DSP TMS320C6678. Организация памяти ядра https://habr.com/ru/articles/331948/#p2


2) Устройство Стека для Intel386 https://habr.com/ru/articles/675522/



Как работает процессор:
1) Как работает CPU: интерактивный урок для начинающих https://habr.com/ru/post/240929/
2) Я не знал, как работают процессоры, поэтому написал программный симулятор https://habr.com/ru/post/453158/
3) Зачем процессорам нужен кэш и чем отличаются уровни L1, L2, L3 https://habr.com/ru/company/vdsina/blog/515660/
4) КАК РАБОТАЕТ ПРОЦЕССОР https://www.youtube.com/watch?v=RwSLO953anc
5) Как работает процессор https://www.youtube.com/watch?v=kIrKeKiJt90
6) Как работает процессор, просто о сложном https://www.youtube.com/watch?v=gcAvhi9sOvA
7) Как работает процессор? https://tproger.ru/explain/how-cpu-works/
8) КАК РАБОТАЕТ ПРОЦЕССОР КОМПЬЮТЕРА? https://losst.ru/kak-rabotaet-protsessor-kompyutera

VLIW:

Спекулятивное исполнение команд:
3) Внеочередное и спекулятивное исполнения стали брешью в безопасности почти всех компьютеров https://nplus1.ru/news/2018/01/04/meltdown

Книги:
1) Дэвид Харрис, Сара Харрис "Цифровая схемотехника и архитектура компьютера" (скачать)
2) J.L.Hennessy, D.A.Patterson. Computer Architecture: A Quantitative Approach. 2007 (pdf)

Кэш-память:
1) Логическая организация кэш-памяти процессора https://habr.com/ru/post/179647/
2) Секреты кэш-памяти, или как потратить 1000 тактов на 10 команд https://habr.com/ru/post/187654/
3) (!)Кэш

Аппаратное устройство:

Устройство компьютерной программы: