Armenian Knowledge Base  

Go Back   Armenian Knowledge Base > Technical sections > Languages, Compilers, Interpreters > Algorithms
Register

Reply
 
LinkBack Thread Tools
Old 19.01.2006, 13:42   #1
Младенец
 
Join Date: 06 2004
Location: Moscow
Age: 39
Posts: 39
Downloads: 0
Uploads: 0
Reputation: 0 | 0
Default Sockety i RTOS

Primerno god nazad byla zadacha napisat' RTOS (Run-Time OS) s podderzhkoi Video, Audio, IPStack-a i t.d.
Osnovnaya problema sostoyala v tom chto u processora dlya koego prednaznachalas' OS ne bylo MMU, t.e. dinamicheskaya pamyat' byla nedostupna.
Ya nadeyalsya shto smogu vospol'zovatsya socketam-i iz linuxa ili iz nekotoryx nezavisimyx istochnikov, no okazalos' shto oni vse orienterovanny na dynamicheskuyu pamyat'.
I tut ya reshil otkazatsya ot ponyatiya socketa i sdelal novye obtekty staticheski dislocirovannye v pamyati, kotorye aktivizitruytusya 100 raz v secundu i obrabatyvayut dannye poluchennye iz ethernet porta.
Poluchennuyu setevuyu biblioteku nazvali HMATNet. V chest' avtorov.
Hmayakyan (Eto ya) Matveev (Eto Ivan Matveev) Net
Reshsenie bylo nastol'ko prostym i xoroshym shto u menya voznik vopros a voobshe sockety eto xorosho ili kak?
Vy ne dumayte ya dostatochno mnogo rabotal s socketami i pod linux, Windows, i pod TI-ovskim NDK, i pod Win CE.
No vse bol'she dumayu shto nashi obyekty byli gorazdo udobnee.
Kstati vysheukazannyh RTOS zarabotal i pozvolyal prinimat' dannye s 4-x kamer nezavisimo 25-kadrov v sekundu. Podderzhyval odin kanal zvuka. Ethernet, COM i esho mnogo chego. Bylo zadeystvovano 60 DMA kanalov.
No samaya slozhnaya chast' etogo RTOS byl IP stack. I vsyo sdelano bylo bez dynamicheskoi pamyati i bez socketov.
Voznikayet vopros esli sockety eto xorosho to pochemu imi nel'zya pol'zovatsya vsyudu i pochemu net dostupnoi i normal'noi biblioteki?
Kstati nasha biblioteka imela dva inputa callback 10 ms i libo ethernet packet, libo esli est' EMAC, adres EMAC ustroistva i predostovlyala pochti polnocennyh IPStack.
Reply With Quote
Old 19.01.2006, 14:33   #2
...overwined...
 
noone's Avatar
 
Join Date: 03 2003
Location: ...tortuga...
Posts: 3,429
Downloads: 3
Uploads: 0
Reputation: 158 | 3
Default Re: Sockety i RTOS

что лучше - чайник или самовар?...
Reply With Quote
Old 19.01.2006, 17:09   #3
Splendid
 
AvDav's Avatar
 
Join Date: 07 2004
Location: Universe
Age: 36
Posts: 3,427
Downloads: 22
Uploads: 0
Reputation: 222 | 3
Default Re: Sockety i RTOS

Chto znachit nelzya polzovatsya vsyudu? Eto bolee ili menee standartizirovanniy interface. Mojno popodrobnee - dlia chego prednaznachena eta RTOS (Real-Time OS), t.e. kak vi obyasnite gramotnomu potrebitelyu chto s pomoshyu vashei RTOS mojno reshat takie-to zadachi kotorie nevozmojno ili ne stol priemlimo reshat pod drugie OS.
Reply With Quote
Old 20.01.2006, 11:23   #4
Младенец
 
Join Date: 06 2004
Location: Moscow
Age: 39
Posts: 39
Downloads: 0
Uploads: 0
Reputation: 0 | 0
Default Re: Sockety i RTOS

to noone

что лучше - чайник или самовар?...

Chaynik


to AvDav

Chto znachit nelzya polzovatsya vsyudu?

Eto znachit chto v sistemax gde net MMU eto ne budet rabotat'.

kak vi obyasnite gramotnomu potrebitelyu chto s pomoshyu vashei RTOS mojno reshat takie-to zadachi kotorie nevozmojno ili ne stol priemlimo reshat pod drugie OS

Obyasnit' eto legko. Esli u vas processor ne podderzhyvayet MMU to u vas ne budet stabil'no rabotat' ni odin standartnyh OS (esli ono voobshe budet rabotat').

Vy pravil'no postavili vopros. Vot imenno sockety privyazany k opredelennomu OS-u. A vot eti novye objekty kotorye predlagayutsya oni ne zavisyat ot OS-a.
10x
Reply With Quote
Old 20.01.2006, 18:35   #5
Splendid
 
AvDav's Avatar
 
Join Date: 07 2004
Location: Universe
Age: 36
Posts: 3,427
Downloads: 22
Uploads: 0
Reputation: 222 | 3
Default Re: Sockety i RTOS

Eto vse predelno yasno - u vas est nekiy processor, skoree vsego microcontroller, kotoriy beret instrukciyu iz pamyati, obrashayas napryamuyu, deshifriruya code operacii, zaranee znaya adresa operandov i t.p. chto samo po sebe i est MMU v prosteyshem variante. No tak kak standartnie biblioteki v konechnom itoge imeyut delo s sitemnimi vizovami, obyektniy code (ego format toje standartizirovan dlia nineshnix populiarnix processorov i kotoriy eshe doljen bit poluchen nekim specificheskim kompilatorom i kompanovshikom v vashem sluchae) kotorix prednaznachen dlia konkretnogo processora, podderjivayushego konkretnuyu organizaciyu (virtualnoi) pamyati (segmentnaya, stranichno-segmentnaya i t.p.), oni ne nashli primeneiya i Vi reshili realizovat vse vishe perechislennie prelesti v vashei RTOS dlia sovmestimosti s apparatnim obespecheniem. No eto poluchaetsa sovsem naoborot - kakim obrazom nezavisyashie ot OS obyekti smogut funkcionirovat pod toi je WinNT skajem, kotoraya rabotaet v zashishennom rejime so stranichnoi organizaciei pamiati?
__________________
All problems in computer science can be solved by another level of indirection. © David Wheeler.
Reply With Quote
Old 23.01.2006, 08:32   #6
Младенец
 
Join Date: 06 2004
Location: Moscow
Age: 39
Posts: 39
Downloads: 0
Uploads: 0
Reputation: 0 | 0
Default Re: Sockety i RTOS

to AvDav

Vy ochen' pravil'no ponyali situaciyu.
Navodyashyh vopros.
Predpolozhim u nas est' nezavisimyh istochnik ethernet packetov i vam nuzhno organizovat' IP Stack kak vy postupite. S usloviem shto vash soft dolzhen rabotat' kak pod windows, tak i pod linux ili lyubuyu druguyu sistemu, dazhe bez MMU (Memory Managment Unit).

Bez MMU praktichesci nevozmozhno organizovat' stabil'nuyu sistemu s dinamicheskoi pamyatyu. Patamu chto, kak vy pravil'no zametili, otsustvuyet mexanizm mappinga fizicheskoi pamyati v virtual'nuyu.
Kstati ya ochen' dolgo dumal kak eto sdelat', t.e. organizovat' dinamicheskuyu pamyat' dlya takix processorov, poka net idey.
Reply With Quote
Old 23.01.2006, 20:08   #7
Splendid
 
AvDav's Avatar
 
Join Date: 07 2004
Location: Universe
Age: 36
Posts: 3,427
Downloads: 22
Uploads: 0
Reputation: 222 | 3
Default Re: Sockety i RTOS

Quote:
Predpolozhim u nas est' nezavisimyh istochnik ethernet packetov i vam nuzhno organizovat' IP Stack kak vy postupite. S usloviem shto vash soft dolzhen rabotat' kak pod windows, tak i pod linux ili lyubuyu druguyu sistemu, dazhe bez MMU (Memory Managment Unit).
Nikak, t.k. v etix OS uje est IPStack v vide driverov dlia sootvetsvuyushego ethernet adaptera Vi napisali specificheskiy driver, dlia konkretnoi arxitekturi.

Quote:
Bez MMU praktichesci nevozmozhno organizovat' stabil'nuyu sistemu s dinamicheskoi pamyatyu. Patamu chto, kak vy pravil'no zametili, otsustvuyet mexanizm mappinga fizicheskoi pamyati v virtual'nuyu.
Kstati ya ochen' dolgo dumal kak eto sdelat', t.e. organizovat' dinamicheskuyu pamyat' dlya takix processorov, poka net idey.
V vashem sluchae skoree vsego ne nujno, t.k. esli processor ne podderjivaet MMU (apparatnaya logica) vam pridetsya ego emulirovat programmno - strashno poteryayte v proizvoditelnosti.

P.S.
Vse chto ya xochu skazat eto to chto vi utverjdayte chto IPStack i realizovannaya vami abstrakciya socketov universalna (platformonezavisima i tem pache - ne zavisit ot zheleza) chto est nonsense.
Reply With Quote
Old 24.01.2006, 08:22   #8
Младенец
 
Join Date: 06 2004
Location: Moscow
Age: 39
Posts: 39
Downloads: 0
Uploads: 0
Reputation: 0 | 0
Default Re: Sockety i RTOS

to AvDav

Quote:
Nikak, t.k. v etix OS uje est IPStack v vide driverov dlia sootvetsvuyushego ethernet adaptera Vi napisali specificheskiy driver, dlia konkretnoi arxitekturi.
IPStack ne zavisit ni ot kakogo adaptera, no tol'ko ot OS, voobshe ona chashe chast' OS-a Ya dumayu vy imeete vvidu driver Etehernet carty, no ona nikak ne vliyayet na rabotu IP Stacka. Ona lish' dopolnyayet ee dlya dannogo ustroistva, exportiruya nekotorye funccii, dlya raboty s HW.
Vopros imenno v tom shtoby razrabotat' ne specificheskih driver, dlya konkretnogo OS. A driver kotoryh mozhet rabotat' prakticheski pod lyubym OS.

Voobshe to ya ne govoril ob obychnyx PC. Vse opisaniya socketov dlya obychnyx OS na obychnyx PC sil'no OS-zavismiy i uzhe sdelany kak vy pravil'no zametili.

Quote:
V vashem sluchae skoree vsego ne nujno, t.k. esli processor ne podderjivaet MMU (apparatnaya logica) vam pridetsya ego emulirovat programmno - strashno poteryayte v proizvoditelnosti.
S etim dovodom skorey vsego pridetsy soglasitsya. Vy sovershenno pravy. No ya nadeyus' esho shto to pridumat' - kakie to obxodnye puti.
Takix processorov shas ochen' mnogo i otsustvie MMU lishaet ix vozmozhnosti podderzhyvat' standartnye OS - Linux, WinCE i td.
Poetomu i ishetsya takoye reshenie.
Reply With Quote
Sponsored Links
Reply

Thread Tools


На правах рекламы:
реклама

All times are GMT. The time now is 12:22.


Powered by vBulletin® Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.