|
nedoPC.orgElectronics hobbyists community established in 2002 |
|
Author |
Message |
Электромонтёр
Fanat
Joined: 23 Feb 2018 22:20 Posts: 91
|
Уважаемые спецы по Линуху! Как использовать физическую память по заданному адресу / объёму как рамдиск? Интересует для микрокомпьютераРазработчик советовал драйвер phram, но родная прошивка скомпилена без поддержки модулей ядра и сам драйвер 2004 года использует древние заголовочные файлы под х86, последнее упоминание phram я нашёл в 2015 под ядро 2.6, а микрокомп на арме и ядро у него 3.1 З.Ы. Попытался русскую локаль поставить - потребление памяти дошло до 67%, далее - килл процесс. Иксы столько памяти не жрали, если честно. Почему русские буквы при установке столько памяти жрать должны - для меня загадка.
Last edited by Электромонтёр on 08 Oct 2020 06:07, edited 1 time in total.
|
04 Oct 2020 10:54 |
|
|
Shaos
Admin
Joined: 08 Jan 2003 23:22 Posts: 22769 Location: Silicon Valley
|
Линух на мелкоконтроллерах это совсем другое - надо к авторам железяки обращаться
|
04 Oct 2020 18:15 |
|
|
Shaos
Admin
Joined: 08 Jan 2003 23:22 Posts: 22769 Location: Silicon Valley
|
Вот например как в физическую память по адресу можно лазить в Petalinux для Zynq (ARM+FPGA): peek.c | | | | Code: /* * peek utility - for those who remember the good old days! * * * Copyright (C) 2013 - 2016 Xilinx, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL XILINX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the Xilinx shall not be used * in advertising or otherwise to promote the sale, use or other dealings in this * Software without prior written authorization from Xilinx. * */
#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/mman.h> #include <fcntl.h>
void usage(char *prog) { printf("usage: %s ADDR\n",prog); printf("\n"); printf("ADDR may be specified as hex values\n"); }
int main(int argc, char *argv[]) { int fd; void *ptr; unsigned addr, page_addr, page_offset; unsigned page_size=sysconf(_SC_PAGESIZE);
if(argc!=2) { usage(argv[0]); exit(-1); }
fd=open("/dev/mem",O_RDONLY); if(fd<1) { perror(argv[0]); exit(-1); }
addr=strtoul(argv[1],NULL,0); page_addr=(addr & ~(page_size-1)); page_offset=addr-page_addr;
ptr=mmap(NULL,page_size,PROT_READ,MAP_SHARED,fd,(addr & ~(page_size-1))); if((int)ptr==-1) { perror(argv[0]); exit(-1); }
printf("0x%08x\n",*((unsigned *)(ptr+page_offset))); return 0; } | | | | |
poke.c | | | | Code: /* * poke utility - for those who remember the good old days! *
* Copyright (C) 2013 - 2016 Xilinx, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL XILINX BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the Xilinx shall not be used * in advertising or otherwise to promote the sale, use or other dealings in this * Software without prior written authorization from Xilinx. * */
#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <sys/mman.h> #include <fcntl.h>
void usage(char *prog) { printf("usage: %s ADDR VAL\n",prog); printf("\n"); printf("ADDR and VAL may be specified as hex values\n"); }
int main(int argc, char *argv[]) { int fd; void *ptr; unsigned val; unsigned addr, page_addr, page_offset; unsigned page_size=sysconf(_SC_PAGESIZE);
fd=open("/dev/mem",O_RDWR); if(fd<1) { perror(argv[0]); exit(-1); }
if(argc!=3) { usage(argv[0]); exit(-1); }
addr=strtoul(argv[1],NULL,0); val=strtoul(argv[2],NULL,0);
page_addr=(addr & ~(page_size-1)); page_offset=addr-page_addr;
ptr=mmap(NULL,page_size,PROT_READ|PROT_WRITE,MAP_SHARED,fd,(addr & ~(page_size-1))); if((int)ptr==-1) { perror(argv[0]); exit(-1); }
*((unsigned *)(ptr+page_offset))=val; return 0; } | | | | |
т.е. всё делается через устройство доступа к памяти /dev/mem
|
06 Oct 2020 21:38 |
|
|
Lavr
Supreme God
Joined: 21 Oct 2009 08:08 Posts: 7777 Location: Россия
|
| | | | Quote: В числе известных операционных систем на базе GNU/Linux можно отметить Ubuntu, Debian, Mint, RHEL (CentOS), openSUSE и российский дистрибутив Astra Linux. Несмотря внушительный список дистрибутивов, сам Linux, по статистике StatCounter за июнь 2020 г., занимал не более 1,69% глобального рынка настольных ОС – 77,68% удерживала Windows, а 17,6-процентная доля принадлежала Apple macOS. | | | | |
(с) https://www.cnews.ru/news/top/2020-07-06_osnovatel_linux_otoshel_ot
_________________ iLavr
|
29 Oct 2020 15:12 |
|
|
Shaos
Admin
Joined: 08 Jan 2003 23:22 Posts: 22769 Location: Silicon Valley
|
| | | | Lavr wrote: | | | | Quote: В числе известных операционных систем на базе GNU/Linux можно отметить Ubuntu, Debian, Mint, RHEL (CentOS), openSUSE и российский дистрибутив Astra Linux. Несмотря внушительный список дистрибутивов, сам Linux, по статистике StatCounter за июнь 2020 г., занимал не более 1,69% глобального рынка настольных ОС – 77,68% удерживала Windows, а 17,6-процентная доля принадлежала Apple macOS. | | | | |
(с) https://www.cnews.ru/news/top/2020-07-06_osnovatel_linux_otoshel_ot | | | | |
Зато он держит 100% топовых серверных систем и бегает на 85% телефонов https://hostingtribunal.com/blog/linux-statistics/P.S. А вот статистика с гуглоаналитики посещений (уникальных юзеров) nedoPC.org за 2020 год: * Tizen is a Linux-based mobile operating system backed by the Linux Foundation but developed and used primarily by Samsung Electronics.P.P.S. Винда далее делится так: т.е. посещения с десктопного линукса примерно сравнимы с посещениями с WinXP
|
29 Oct 2020 16:12 |
|
|
Lavr
Supreme God
Joined: 21 Oct 2009 08:08 Posts: 7777 Location: Россия
|
Статистика - великая вещь! Надо только верно толковать, что она значит... Поскольку с Венды 98 сюда захаживаю только я, то выходит, что с Линуха заходят трое или, возможно, даже двое, если учесть, что ты заходишь часто... Следовательно, большинство посещает этот форум с Венды-10...
_________________ iLavr
|
29 Oct 2020 17:21 |
|
|
Shaos
Admin
Joined: 08 Jan 2003 23:22 Posts: 22769 Location: Silicon Valley
|
ненадо недооценивать любовь людей к старине и потом это Users, а не Hits и даже не Sessions, т.е. уникальные пользователи, определяемые куками https://support.google.com/analytics/answer/2992042?hl=enP.S. Хотя если ты ходишь с включённым анонимайзером и/или чистишь куки после каждого захода, то тогда таки да - она будет считать только тебя
|
29 Oct 2020 18:21 |
|
|
Lavr
Supreme God
Joined: 21 Oct 2009 08:08 Posts: 7777 Location: Россия
|
Да ни в коем случае! Респект и уважуха любителям рЭтро-(как писал один ушлый корифан)-ОС! Поскольку ты все ай-пи видишь, намекни мне как-нибуть в личку - у кого тут ещё Венда-98... P.S. У меня Опера 9-64 автоматом чистит куки при выключении.
_________________ iLavr
|
29 Oct 2020 18:37 |
|
|
Shaos
Admin
Joined: 08 Jan 2003 23:22 Posts: 22769 Location: Silicon Valley
|
По опере за тот же период у меня расклад такой: так что похоже, что с 98й виндой это таки только ты (ну может 432-431=1 раз кто-то ещё зашёл с винды 98 другим браузером) P.S. Я куки чищу только когда браузер закрываю, а закрываю я его когда сервер ребутается, что случается раз в месяца 3-4 так что по линуксу - реальные юзеры
|
29 Oct 2020 18:57 |
|
|
Lavr
Supreme God
Joined: 21 Oct 2009 08:08 Posts: 7777 Location: Россия
|
Возможно, это тоже я - "зашёл с винды 98 другим браузером", ибо, как и положено Венде-98, у неё есть штатный ИЕ-5. Я его включаю очень редко - проверить: глюк Оперы или провайдер косячит, что редко, но случается.
_________________ iLavr
|
29 Oct 2020 19:36 |
|
|
Электромонтёр
Fanat
Joined: 23 Feb 2018 22:20 Posts: 91
|
Подскажите, как подмонтировать ntfs на чтение/запись раздел НЕ используя модули ядра?
|
05 Nov 2020 07:54 |
|
|
Shaos
Admin
Joined: 08 Jan 2003 23:22 Posts: 22769 Location: Silicon Valley
|
давным-давно есть юзерспейс драйвер (через FUSE), насколько я помню - он даже по умолчанию включён в дебияне | | | | Code: ntfs-3g 2016.2.22AR.1 integrated FUSE 28 - Third Generation NTFS Driver Configuration type 7, XATTRS are on, POSIX ACLS are on
Copyright (C) 2005-2007 Yura Pakhuchiy Copyright (C) 2006-2009 Szabolcs Szakacsits Copyright (C) 2007-2016 Jean-Pierre Andre Copyright (C) 2009 Erik Larsson
Usage: ntfs-3g [-o option[,...]] <device|image_file> <mount_point>
Options: ro (read-only mount), windows_names, uid=, gid=, umask=, fmask=, dmask=, streams_interface=. Please see the details in the manual (type: man ntfs-3g).
Example: ntfs-3g /dev/sda1 /mnt/windows
News, support and information: http://tuxera.com
| | | | |
|
05 Nov 2020 11:03 |
|
|
Электромонтёр
Fanat
Joined: 23 Feb 2018 22:20 Posts: 91
|
ntfs-3g через fuse не годится, оно требует поддержки модулей ядра.
|
05 Nov 2020 14:36 |
|
|
Shaos
Admin
Joined: 08 Jan 2003 23:22 Posts: 22769 Location: Silicon Valley
|
ну fuse вроде в ядре по умолчанию, нет?
|
05 Nov 2020 16:17 |
|
|
Электромонтёр
Fanat
Joined: 23 Feb 2018 22:20 Posts: 91
|
fuse у меня не работает. Производителем заявлено отсутствие поддержки модулей ядра в образе. при попытке запустить ntfs-3g, modprobe fuse ругается нецензурными словами. Дособрать и скомпилить поддержку ядра никак. Только пересборка прошивки.
|
05 Nov 2020 22:10 |
|
|
Who is online |
Users browsing this forum: No registered users and 0 guests |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|