Subversion Repositories Kolibri OS

Rev

Rev 109 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 109 Rev 199
Line 4... Line 4...
4
;                                          ;
4
;                                          ;
5
;   Compile with FASM for Menuet           ;
5
;   Compile with FASM for Menuet           ;
6
;                                          ;
6
;                                          ;
7
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 8... Line -...
8
 
-
 
Line -... Line 8...
-
 
8
 
9
use32
9
 
-
 
10
memsize = 100000h
-
 
11
               org 0
-
 
12
PARAMS  = memsize - 1024
Line 10... Line 13...
10
 
13
 
11
               org    0x0
14
use32
12
 
15
 
13
               db     'MENUET01'              ; 8 byte id
16
               db     'MENUET01'              ; 8 byte id
14
               dd     0x01                    ; header version
17
               dd     0x01                    ; header version
15
               dd     START                   ; start of code
18
               dd     START                   ; start of code
16
               dd     I_END                   ; size of image
19
               dd     I_END                   ; size of image
Line 17... Line 20...
17
               dd     0x100000                ; memory for app
20
               dd     memsize                 ; memory for app
18
               dd     0x7fff0                 ; esp
21
               dd     memsize - 1024          ; esp
Line -... Line 22...
-
 
22
               dd     PARAMS , 0x0            ; I_Param , I_Icon
-
 
23
 
-
 
24
include 'lang.inc'
-
 
25
START:                          ; start of execution
-
 
26
 
19
               dd     0x0 , 0x0               ; I_Param , I_Icon
27
    cmp     [PARAMS], byte 0
Line 20... Line 28...
20
 
28
    jne     check_parameters
Line 21... Line 29...
21
include 'lang.inc'
29
 
Line 60... Line 68...
60
 
68
 
61
    cmp  eax,2
69
    cmp  eax,2
Line 62... Line 70...
62
    je   read_stack_setup
70
    je   read_stack_setup
63
 
71
 
-
 
72
    cmp  eax,3
-
 
73
    jne  no_apply_stack_setup
Line -... Line 74...
-
 
74
    call apply_stack_setup
64
    cmp  eax,3
75
    jmp  still
65
    je   apply_stack_setup
76
 
66
 
77
no_apply_stack_setup:
67
    cmp  eax,11
78
    cmp  eax,11
68
    jb   no_set_interface
79
    jb   no_set_interface
Line 354... Line 365...
354
    mov  eax,52
365
    mov  eax,52
355
    mov  ebx,2
366
    mov  ebx,2
356
    mov  ecx,[config]
367
    mov  ecx,[config]
357
    int  0x40
368
    int  0x40
Line -... Line 369...
-
 
369
 
358
 
370
    ret
Line 359... Line 371...
359
    jmp  still
371
    jmp  still
360
 
372
 
Line 463... Line 475...
463
 
475
 
464
                                   ; DRAW WINDOW
476
                                   ; DRAW WINDOW
465
    mov  eax,0                     ; function 0 : define and draw window
477
    mov  eax,0                     ; function 0 : define and draw window
466
    mov  ebx,100*65536+330         ; [x start] *65536 + [x size]
478
    mov  ebx,100*65536+330         ; [x start] *65536 + [x size]
467
    mov  ecx,100*65536+157         ; [y start] *65536 + [y size]
479
    mov  ecx,100*65536+157         ; [y start] *65536 + [y size]
468
    mov  edx,0x03ffffff            ; color of work area RRGGBB,8->color gl
-
 
469
    mov  esi,0x806688cc
-
 
470
    mov  edi,0x006688cc
-
 
471
    int  0x40
-
 
472
 
480
    mov  edx,0x13ffffff            ; color of work area RRGGBB,8->color gl
473
                                   ; WINDOW LABEL
-
 
474
    mov  eax,4                     ; function 4 : write text to window
-
 
475
    mov  ebx,8*65536+8             ; [x start] *65536 + [y start]
-
 
476
    mov  ecx,0x00ddeeff            ; color of text RRGGBB
-
 
477
    mov  edx,labelt                ; pointer to text beginning
-
 
478
    mov  esi,labellen-labelt       ; text length
481
    mov  edi,header                ; WINDOW LABEL
Line 479... Line -...
479
    int  0x40
-
 
480
 
-
 
481
 
-
 
482
    mov  eax,8                     ; BUTTON : CLOSE WINDOW
-
 
483
    mov  ebx,(330-19)*65536+12
-
 
484
    mov  ecx,5*65536+12
-
 
485
    mov  edx,1
-
 
486
    mov  esi,[button_color]
482
    int  0x40
487
;    int  0x40
483
 
488
 
484
                                   
489
    mov  eax,8                     ; BUTTON : READ SETUP
485
    mov  eax,8                     ; BUTTON : READ SETUP
-
 
486
    mov  ebx,90*65536+65
490
    mov  ebx,90*65536+65
487
    mov  ecx,127*65536+12
Line 491... Line 488...
491
    mov  ecx,127*65536+12
488
    mov  edx,2
492
    mov  edx,2
489
    mov  esi,[button_color]
493
    int  0x40
490
    int  0x40
494
 
491
 
495
    mov  eax,8                     ; BUTTON : APPLY SETUP
492
    ;mov  eax,8                     ; BUTTON : APPLY SETUP
Line 496... Line 493...
496
    mov  ebx,163*65536+65
493
    mov  ebx,163*65536+65
497
    mov  ecx,127*65536+12
494
    mov  ecx,127*65536+12
498
    mov  edx,3
495
    mov  edx,3
499
    int  0x40
496
    int  0x40
500
 
497
 
501
    mov  eax,8                     ; BUTTONS 11-14 : SELECT INTERFACE
498
    ;mov  eax,8                     ; BUTTONS 11-14 : SELECT INTERFACE
Line 522... Line 519...
522
    mov  ebx,143*65536+8
519
    mov  ebx,143*65536+8
523
    mov  ecx,69*65536+8
520
    mov  ecx,69*65536+8
524
    mov  edx,21
521
    mov  edx,21
525
    mov  esi,[button_color]
522
    mov  esi,[button_color]
526
    int  0x40
523
    int  0x40
527
    mov  eax,8
524
    ;mov  eax,8
528
    mov  ebx,143*65536+8
525
    mov  ebx,143*65536+8
529
    mov  ecx,79*65536+8
526
    mov  ecx,79*65536+8
530
    mov  edx,22
527
    mov  edx,22
531
    int  0x40
528
    int  0x40
532
    mov  ebx,[assigned]           ; PRINT SELECTED SERVER/MANUAL 'X'
529
    mov  ebx,[assigned]           ; PRINT SELECTED SERVER/MANUAL 'X'
Line 545... Line 542...
545
    mov  ecx,[com_add]
542
    mov  ecx,[com_add]
546
    mov  edx,272*65536+40
543
    mov  edx,272*65536+40
547
    mov  esi,0x000000
544
    mov  esi,0x000000
548
    int  0x40
545
    int  0x40
Line 549... Line 546...
549
 
546
 
550
    mov  eax,47                   ; COM IRQ
547
    ;mov  eax,47                   ; COM IRQ
551
    mov  ebx,1*65536+1*256
548
    mov  ebx,1*65536+1*256
552
    mov  ecx,[com_irq]
549
    mov  ecx,[com_irq]
553
    mov  edx,(266+3*6)*65536+50
550
    mov  edx,(266+3*6)*65536+50
554
    mov  esi,0x000000
551
    mov  esi,0x000000
Line 557... Line 554...
557
    mov  edi,ip_address
554
    mov  edi,ip_address
558
    mov  edx,205*65536+80
555
    mov  edx,205*65536+80
559
    mov  esi,0x000000
556
    mov  esi,0x000000
560
    mov  ebx,3*65536
557
    mov  ebx,3*65536
561
  ipdisplay:
558
  ipdisplay:
562
    mov  eax,47
559
    ;mov  eax,47
563
    movzx ecx,byte [edi]
560
    movzx ecx,byte [edi]
564
    int  0x40
561
    int  0x40
565
    add  edx,6*4*65536
562
    add  edx,6*4*65536
566
    inc  edi
563
    inc  edi
567
    cmp  edi,ip_address+4
564
    cmp  edi,ip_address+4
Line 570... Line 567...
570
    mov  edi,gateway_ip
567
    mov  edi,gateway_ip
571
    mov  edx,205*65536+90
568
    mov  edx,205*65536+90
572
    mov  esi,0x000000
569
    mov  esi,0x000000
573
    mov  ebx,3*65536
570
    mov  ebx,3*65536
574
  gipdisplay:
571
  gipdisplay:
575
    mov  eax,47
572
    ;mov  eax,47
576
    movzx ecx,byte [edi]
573
    movzx ecx,byte [edi]
577
    int  0x40
574
    int  0x40
578
    add  edx,6*4*65536
575
    add  edx,6*4*65536
579
    inc  edi
576
    inc  edi
580
    cmp  edi,gateway_ip+4
577
    cmp  edi,gateway_ip+4
Line 583... Line 580...
583
    mov  edi,subnet_mask
580
    mov  edi,subnet_mask
584
    mov  edx,205*65536+100
581
    mov  edx,205*65536+100
585
    mov  esi,0x000000
582
    mov  esi,0x000000
586
    mov  ebx,3*65536
583
    mov  ebx,3*65536
587
  sipdisplay:
584
  sipdisplay:
588
    mov  eax,47
585
    ;mov  eax,47
589
    movzx ecx,byte [edi]
586
    movzx ecx,byte [edi]
590
    int  0x40
587
    int  0x40
591
    add  edx,6*4*65536
588
    add  edx,6*4*65536
592
    inc  edi
589
    inc  edi
593
    cmp  edi,subnet_mask+4
590
    cmp  edi,subnet_mask+4
Line 596... Line 593...
596
    mov  edi,dns_ip
593
    mov  edi,dns_ip
597
    mov  edx,205*65536+110
594
    mov  edx,205*65536+110
598
    mov  esi,0x000000
595
    mov  esi,0x000000
599
    mov  ebx,3*65536
596
    mov  ebx,3*65536
600
  dipdisplay:
597
  dipdisplay:
601
    mov  eax,47
598
    ;mov  eax,47
602
    movzx ecx,byte [edi]
599
    movzx ecx,byte [edi]
603
    int  0x40
600
    int  0x40
604
    add  edx,6*4*65536
601
    add  edx,6*4*65536
605
    inc  edi
602
    inc  edi
606
    cmp  edi,dns_ip+4
603
    cmp  edi,dns_ip+4
Line 611... Line 608...
611
    mov  ebx,299*65536+8
608
    mov  ebx,299*65536+8
612
    mov  ecx,39*65536+8
609
    mov  ecx,39*65536+8
613
    mov  edx,5
610
    mov  edx,5
614
    mov  esi,[button_color]
611
    mov  esi,[button_color]
615
    int  0x40
612
    int  0x40
616
    mov  eax,8                     ; BUTTON 6 : SET IRQ
613
    ;mov  eax,8                     ; BUTTON 6 : SET IRQ
617
    mov  ebx,299*65536+8
614
    mov  ebx,299*65536+8
618
    mov  ecx,49*65536+8
615
    mov  ecx,49*65536+8
619
    mov  edx,6
616
    mov  edx,6
620
    int  0x40
617
    int  0x40
621
    mov  eax,8                     ; BUTTON 7 : SET IP
618
    ;mov  eax,8                     ; BUTTON 7 : SET IP
622
    mov  ebx,299*65536+8
619
    mov  ebx,299*65536+8
623
    mov  ecx,79*65536+8
620
    mov  ecx,79*65536+8
624
    mov  edx,7
621
    mov  edx,7
625
    int  0x40
622
    int  0x40
Line 626... Line 623...
626
 
623
 
627
    mov  eax,8                     ; BUTTON 8 : SET gateway IP
624
    ;mov  eax,8                     ; BUTTON 8 : SET gateway IP
628
    mov  ebx,299*65536+8
625
    mov  ebx,299*65536+8
629
    mov  ecx,89*65536+8
626
    mov  ecx,89*65536+8
630
    mov  edx,8
627
    mov  edx,8
Line 631... Line 628...
631
    int  0x40
628
    int  0x40
632
 
629
 
633
    mov  eax,8                     ; BUTTON 9 : SET subnet
630
    ;mov  eax,8                     ; BUTTON 9 : SET subnet
634
    mov  ebx,299*65536+8
631
    mov  ebx,299*65536+8
635
    mov  ecx,99*65536+8
632
    mov  ecx,99*65536+8
Line 636... Line 633...
636
    mov  edx,9
633
    mov  edx,9
637
    int  0x40
634
    int  0x40
638
 
635
 
639
    mov  eax,8                     ; BUTTON 10 : SET dns ip
636
    ;mov  eax,8                     ; BUTTON 10 : SET dns ip
640
    mov  ebx,299*65536+8
637
    mov  ebx,299*65536+8
Line 641... Line 638...
641
    mov  ecx,109*65536+8
638
    mov  ecx,109*65536+8
642
    mov  edx,10
639
    mov  edx,10
643
    int  0x40
640
    int  0x40
-
 
641
 
644
 
642
    mov  ebx,31*65536+40           ; draw info text with function 4
645
    mov  ebx,31*65536+40           ; draw info text with function 4
643
    mov  edx,text
646
    mov  edx,text
644
    mov  esi,49
647
    mov  esi,49
645
    mov  eax,4
648
  newline:
646
  newline:
649
    mov  ecx,0x224466
647
    mov  ecx,0x224466
650
    cmp  [edx],byte 'w'
648
    cmp  [edx],byte 'w'
651
    jne  nowhite
-
 
652
    mov  ecx,0xeeeeee
649
    jne  nowhite
653
   nowhite:
650
    mov  ecx,0xeeeeee
654
    inc  edx
651
   nowhite:
655
    mov  eax,4
652
    inc  edx
656
    int  0x40
653
    int  0x40
Line 663... Line 660...
663
    mov  ebx,2                     ; 2, end of draw
660
    mov  ebx,2                     ; 2, end of draw
664
    int  0x40
661
    int  0x40
Line 665... Line 662...
665
 
662
 
Line -... Line 663...
-
 
663
    ret
-
 
664
 
-
 
665
;******************************************************************************
-
 
666
 
-
 
667
check_parameters:
-
 
668
    cmp     [PARAMS], dword "BOOT" ; received BOOT parameter -> goto handler
-
 
669
    je      boot_set_settings
-
 
670
    jmp     no_params
-
 
671
 
-
 
672
;******************************************************************************
-
 
673
 
-
 
674
boot_set_settings:
-
 
675
 
-
 
676
    mov  eax,52
-
 
677
    mov  ebx,0
-
 
678
    int  0x40
-
 
679
    mov  [config],eax
-
 
680
 
-
 
681
    shr  eax,8          ; unwrap com IRQ
-
 
682
    and  eax,0xf
-
 
683
    mov  [com_irq],eax
-
 
684
 
-
 
685
    mov  eax,[config]   ; unwrap com PORT
-
 
686
    shr  eax,16
-
 
687
    and  eax,0xfff
-
 
688
    mov  [com_add],eax
-
 
689
 
-
 
690
    call apply_stack_setup
-
 
691
   
-
 
692
    mov  eax,-1                 ; close this program
-
 
693
    int  0x40
-
 
694
 
Line 666... Line 695...
666
    ret
695
;******************************************************************************
Line 667... Line 696...
667
 
696
 
668
 
697
 
Line 678... Line 707...
678
    db '                      Subnet:    .   .   .    <   '
707
    db '                      Subnet:    .   .   .    <   '
679
    db '                      DNS IP:    .   .   .    <   '
708
    db '                      DNS IP:    .   .   .    <   '
680
    db '                                                  '
709
    db '                                                  '
681
    db 'w             READ        APPLY                   '
710
    db 'w             READ        APPLY                   '
Line 682... Line 711...
682
 
711
 
Line 683... Line 712...
683
xx: db 'x <- END MARKER, DONT DELETE            '
712
xx: db 'x' ;<- END MARKER, DONT DELETE
Line 684... Line 713...
684
 
713
 
685
button_color dd  0x2254b9
-
 
Line 686... Line 714...
686
 
714
button_color dd  0x2254b9
687
labelt:     db  'STACK CONFIGURATION'
715
 
688
labellen:
716
header      db  'STACK CONFIGURATION',0
689
 
717
 
Line 690... Line 718...
690
ip_address  db  000,000,000,000
718
ip_address  db  010,005,004,175
691
gateway_ip  db  000,000,000,000
719
gateway_ip  db  010,005,000,001
692
subnet_mask db  000,000,000,000
720
subnet_mask db  255,255,000,000
693
dns_ip      db  000,000,000,000
721
dns_ip      db  213,184,238,006
Line 694... Line 722...
694
 
722
 
Line 695... Line 723...
695
com_irq     dd      0   ; irq for slip/ppp
723
com_irq     dd      0   ; irq for slip/ppp