Board.KolibriOS.org

Official KolibriOS board
It is currently Sat Oct 16, 2021 3:30 pm

All times are UTC+03:00




Post new topic  Reply to topic  [ 188 posts ]  Go to page Previous 19 10 11 12 13 Next
Author Message
PostPosted: Sat Jun 19, 2021 7:43 pm 
Offline
User avatar

Joined: Mon Apr 06, 2020 1:09 pm
Posts: 112
Rewritten to fasm:
Spoiler: Show
Code:
format binary as "kex"
use32
org 0
db 'MENUET01'
dd 1
dd START
dd I_END
dd MEM
dd STACKTOP
dd 0
dd 0
START:
  ; IF WE UNCOMMENT THESE FOUR LINES
  ; THEN WORKS GOOD
  ; SO WE CAN MAKE CONCLUSION
  ; THAT BUG OCCURS WHEN
  ; WE PASS 70.2 A MEMORY REGION WHICH
  ; CONTAINS UNMAPPED VIRTUAL PAGES
 
  ;mov eax, 64
  ;mov ebx, 1
  ;mov ecx, MEM + 100500
  ;int 0x40

  mov eax, 70
  mov ebx, fs_info_block
  int 0x40

  mov eax, -1
  int 0x40

; data
fs_info_block:
  dd 2
  dd 0
  dd 0
  dd MEM + 100500 ; data size
  dd 0 ; buf addr
  db '/tmp0/1/0.raw', 0

I_END:
  rb 4096
align 16
STACKTOP:
MEM:

_________________
The best way to predict the future is to create it.


Top
   
PostPosted: Sun Jun 20, 2021 3:37 pm 
Offline
Mentor
User avatar

Joined: Mon Oct 19, 2009 10:58 am
Posts: 683
Current FS code works like this: lock (a mutex guarding access to) a partition, read/write data, unlock the partition.
When a thread crashes while reading/writing, the partition is left locked. Therefore other programs can't acquire the lock and access that partition anymore.

To illustrate this logic you can run board to save its log to e.g. /hd0/1/, and then run your test program. This way /tmp0/1/ will be locked but board will be still working with /hd0/1/.

In theory, kernel could release acquired locks when threads crash. In practice, kernel has no idea what locks have been acquired by a given thread.
It is possilble to modify FS code to fill an array of acquired locks. In fact, this is very similar to an array of file descriptors.

So, resolution of this issue could be a side effect of file descriptors when they are implemented.


Top
   
PostPosted: Sun Jun 20, 2021 4:51 pm 
Offline
Designer
User avatar

Joined: Thu Jan 25, 2007 3:33 pm
Posts: 5540
As this is a critical issue, can we have a temporary solution to fix such lock?

_________________
Звиздеть не мешки ворочать


Top
   
PostPosted: Sun Jun 20, 2021 5:10 pm 
Offline
Mentor
User avatar

Joined: Mon Oct 19, 2009 10:58 am
Posts: 683
Sorry, but I'm not ready to start this work. I have many things started that are waiting to be finished.
If somebody wants to work on the issue, I can share my knowledge of FS code.

I have filed a bug 139.


Top
   
PostPosted: Mon Jun 21, 2021 3:26 pm 
Offline
Designer
User avatar

Joined: Thu Jan 25, 2007 3:33 pm
Posts: 5540
In revision #8680 there seems to be a regression with file working.
Reproduces with acpi app from this comment https://board.kolibrios.org/viewtopic.p ... 105#p37822 => devices.dat and log files are 0 bytes and there is an error "sysfunc70 addr error" in the Board.
I already notified the commit author rgimad and he will check the issue.

_________________
Звиздеть не мешки ворочать


Top
   
PostPosted: Tue Jun 22, 2021 9:16 am 
Offline
User avatar

Joined: Mon Apr 06, 2020 1:09 pm
Posts: 112
I temporarily disabled safety checks in sysfn70 , so acpi driver works now. But in future we need to add filesystem functions to kernel exports and make drivers use them. Drivers must not use sysfns via int 0x40, they are not userspace programs.

_________________
The best way to predict the future is to create it.


Top
   
PostPosted: Thu Jul 08, 2021 2:45 am 
Offline
Designer
User avatar

Joined: Thu Jan 25, 2007 3:33 pm
Posts: 5540
У меня на ПК не доступен мой главный диск D: тот что Work.
Ни в режиме ACHI ни IDE (список одинаков для обоих режимов), так что тут ядро, а не драйвер.

Список дисков в Колибри выглядит странно.
Смотрите скрины.


Attachments:
first32k [32 KiB]
Downloaded 21 times
Screenshot_2.png
Screenshot_2.png [ 103.89 KiB | Viewed 1119 times ]

_________________
Звиздеть не мешки ворочать


Last edited by Leency on Thu Jul 08, 2021 9:24 pm, edited 2 times in total.
Top
   
PostPosted: Thu Jul 08, 2021 3:11 am 
Offline
Mentor
User avatar

Joined: Mon Oct 19, 2009 10:58 am
Posts: 683
Looks like something goes wrong in MBR or GPT code.
Please, attach first 32kB of these disks like you did here.


Top
   
PostPosted: Thu Jul 08, 2021 9:27 pm 
Offline
Designer
User avatar

Joined: Thu Jan 25, 2007 3:33 pm
Posts: 5540
dunkaist wrote:
Looks like something goes wrong in MBR or GPT code.
Please, attach first 32kB of these disks like you did here.
My previous post was updated.
Btw, Elementary OS (Linux) where I've taken dd, do not show my D:[Work] volume in File manager.

_________________
Звиздеть не мешки ворочать


Top
   
PostPosted: Fri Jul 09, 2021 6:42 am 
Offline
Mentor
User avatar

Joined: Mon Oct 19, 2009 10:58 am
Posts: 683
The short story of _what_ happend:
  • GetFileInfo (sf70.5) called here returned an error code sometimes,
  • the return value wasn't checked,
  • the buffer had uninitialized data,
  • which led to strange disk size.

The longer story of _why_ it happened.
  • A partition size that is reported by sf70.5 is read by FS-specific code. E.g. if /hd0/1 is FAT, then fat_GetFileInfo is called to get its size.
  • Yes, partition size doesn't depend on a particular FS on it: you can format the same partition as FAT, then EXT. But the code is written so that FS-specific code reports the size of the underlying partition.
  • So if FS isn't supported, then there is no FS-specific code associated with the partition to report its size.
  • Yes, there is a default/fallback stub for the case when no real FS was detected on a partition. But that stub returned the _not_implemented_ error unconditionally.
  • I implemented sf70.5 for that stub to report a partition size in #9043. This should resolve the issue with wrong partition sizes.
  • The issue with NTFS is a separate one. I'm not familiar with NTFS and therefore I have no idea of what's going on there.
  • But a dump of the partition's superblock is a common place to start. So, please, run one more command and attach resulting superblock file.
    Code:
    dd if=/dev/sda6 of=superb bs=512 count=2

p.s. -- GPT code was ok


Top
   
PostPosted: Fri Jul 09, 2021 3:07 pm 
Offline
Designer
User avatar

Joined: Thu Jan 25, 2007 3:33 pm
Posts: 5540
Here is the file.

Thanks for the bug report of Eolite! This is fixed.


Attachments:
superb [1 KiB]
Downloaded 23 times

_________________
Звиздеть не мешки ворочать
Top
   
PostPosted: Fri Jul 09, 2021 3:47 pm 
Offline
Mentor
User avatar

Joined: Mon Oct 19, 2009 10:58 am
Posts: 683
The file doesn't look like a superblock. It looks more like to random data or something encrypted.

Leency wrote:
Btw, Elementary OS (Linux) where I've taken dd, do not show my D:[Work] volume in File manager.

So, is it encrypted?


Top
   
PostPosted: Sat Jul 10, 2021 11:08 am 
Offline
Designer
User avatar

Joined: Thu Jan 25, 2007 3:33 pm
Posts: 5540
I don't really know what it was. I formatted by disk and now C: and D: so now disks are available.
Thanks for support.

_________________
Звиздеть не мешки ворочать


Top
   
PostPosted: Sat Jul 10, 2021 11:29 am 
Offline

Joined: Tue Dec 08, 2020 10:26 pm
Posts: 33
(Offtopic) Вопрос не относящийся к Kolibrios, но близок к теме топика.

У меня, при использовании Xenial Puppy LiveCD видятся все внешние диски на интерфейсе USB (подключен SSD)
а при загрузке Bionic (Fossa) Puppy LiveCD один из дисков не виден в системе.
Этому есть какое то объяснение?

P.S. И ещё попутно заметил, что DosBox не отображает директорию диска примонтированного внешнего диска с USB.


Top
   
PostPosted: Sat Jul 10, 2021 11:46 am 
Offline
Mentor
User avatar

Joined: Mon Oct 19, 2009 10:58 am
Posts: 683
KPG wrote:
P.S. И ещё попутно заметил, что DosBox не отображает директорию диска примонтированного внешнего диска с USB.

This bug? viewtopic.php?f=43&t=671&start=120#p76432

KPG wrote:
(Offtopic) Вопрос не относящийся к Kolibrios, но близок к теме топика.

У меня, при использовании Xenial Puppy LiveCD видятся все внешние диски на интерфейсе USB (подключен SSD)
а при загрузке Bionic (Fossa) Puppy LiveCD один из дисков не виден в системе.
Этому есть какое то объяснение?

Что ты имеешь в виду под "не виден"? В lsblk (или blkid) он есть? Речь именно про диск или про раздел и ФС на нём?


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 188 posts ]  Go to page Previous 19 10 11 12 13 Next

All times are UTC+03:00


Who is online

Users browsing this forum: No registered users and 1 guest


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

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited